Skip to content

Commit acfad48

Browse files
committed
comment on hidden modules
1 parent e6c86c9 commit acfad48

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nn/_generate_layers.py

+6
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,12 @@ def get_module_class_name_for_layer_class(sig: LayerSignature) -> str:
873873
name = name[:-len("Layer")]
874874
if name.startswith("_"):
875875
return name
876+
# LayersHidden is our explicit list.
877+
# When some layer is purely functional (is_functional), then we just make the function public
878+
# but keep the wrapped layer maker hidden.
879+
# When it has recurrent state, we either have a public function in case it is functional (no params),
880+
# or if not (e.g. RecLayer, TwoDLSTMLayer), we anyway better should use explicit public wrappers.
881+
# https://github.com/rwth-i6/returnn_common/issues/31
876882
if layer_class.layer_class in LayersHidden or sig.is_functional() or sig.has_recurrent_state():
877883
return "_" + name # we make a public function for it, but the module is hidden
878884
return name

0 commit comments

Comments
 (0)