Skip to content

Commit 35badc0

Browse files
EmGarrfacebook-github-bot
authored andcommitted
Fix inversion between fine and coarse implicit_functions
Summary: Fine implicit function was called before the coarse implicit function. Reviewed By: shapovalov Differential Revision: D46224224 fbshipit-source-id: 6b1cc00cc823d3ea7a5b42774c9ec3b73a69edb5
1 parent e0c3ca9 commit 35badc0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pytorch3d/implicitron/models/overfit_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def forward(
373373
self.implicit_function
374374
]
375375
if self.coarse_implicit_function is not None:
376-
implicit_functions += [self.coarse_implicit_function]
376+
implicit_functions = [self.coarse_implicit_function, self.implicit_function]
377377

378378
if self.global_encoder is not None:
379379
global_code = self.global_encoder( # pyre-fixme[29]

tests/implicitron/models/test_overfit_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ def test_overfit_model_vs_generic_model_with_batch_size_one(self):
109109

110110
# Adapt the mapping from generic model to overfit model
111111
mapping_om_from_gm = {
112-
key.replace("_implicit_functions.0._fn", "implicit_function").replace(
113-
"_implicit_functions.1._fn", "coarse_implicit_function"
114-
): val
112+
key.replace(
113+
"_implicit_functions.0._fn", "coarse_implicit_function"
114+
).replace("_implicit_functions.1._fn", "implicit_function"): val
115115
for key, val in generic_model.state_dict().items()
116116
}
117117
# Copy parameters from generic_model to overfit_model

0 commit comments

Comments
 (0)