Skip to content
Snippets Groups Projects
Commit 4e2344e8 authored by Gordian Edenhofer's avatar Gordian Edenhofer
Browse files

Model.__init__: Harden against circles

Resolves #427 .
parent 9f7abcf1
No related branches found
No related tags found
1 merge request!1010Model.__init__: Harden against very early attribute references
Pipeline #246096 passed
......@@ -216,6 +216,11 @@ class Model(LazyModel):
if domain is NoValue and init is not NoValue:
domain = eval_shape(init, Initializer.domain)
if target is NoValue and domain is not NoValue:
# Set attributes as to allow references back from self.__call__
# They will be set to the correct value in `super().__init__`
self._domain = domain
self._target = None
self._init = None
target = eval_shape(self, domain) # Honor overloaded `__call__`
super().__init__(domain=domain, init=init, target=target)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment