Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always enable flat net construction #1002

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

albertz
Copy link
Member

@albertz albertz commented Mar 17, 2022

Fix #992.

Maybe also fix #957 (need to test this).

@albertz
Copy link
Member Author

albertz commented Mar 17, 2022

The subnet issue described in #957 is maybe like this:

Root net has some CondLayer or MaskedComputationLayer or RecLayer, which itself goes back to the root net.

_NetworkConstructionStack is actually per net but in flat_construct, it catches all _DelayedConstructionException, even for other nets. This is probably wrong.

@albertz
Copy link
Member Author

albertz commented Mar 17, 2022

About other exceptions in construct_layer: We placed the flat construction logic later because we want that LayerNotFound is directly raised. We maybe should generalize this. we can effectively catch any raised exceptions, and once construct_layer is called again, it would reraise that earlier exception. Or when called again, then not run into the flat construction but directly construct? Maybe allow construction stack depth 2?

@albertz
Copy link
Member Author

albertz commented Mar 17, 2022

Need some comment why nested flat construction is ok. Basically: E.g. in RecLayer, when getting back to base net, we don't want a partial rec template construction to reset. So, it will not be deep w.r.t. to such layers which define new ctx boundaries. But that is not really a problem.

@albertz
Copy link
Member Author

albertz commented Mar 17, 2022

The handling of exceptions is problematic, esp together with the Rec template construction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant