Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NIFTy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
NIFTy
Commits
4e2344e8
Commit
4e2344e8
authored
3 weeks ago
by
Gordian Edenhofer
Browse files
Options
Downloads
Patches
Plain Diff
Model.__init__: Harden against circles
Resolves
#427
.
parent
9f7abcf1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1010
Model.__init__: Harden against very early attribute references
Pipeline
#246096
passed
3 weeks ago
Stage: build_docker
Stage: test
Stage: demo_runs
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/re/model.py
+5
-0
5 additions, 0 deletions
src/re/model.py
with
5 additions
and
0 deletions
src/re/model.py
+
5
−
0
View file @
4e2344e8
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment