Skip to content

Commit

Permalink
Fix inversion between fine and coarse implicit_functions
Browse files Browse the repository at this point in the history
Summary: Fine implicit function was called before the coarse implicit function.

Reviewed By: shapovalov

Differential Revision: D46224224

fbshipit-source-id: 6b1cc00cc823d3ea7a5b42774c9ec3b73a69edb5
  • Loading branch information
EmGarr authored and facebook-github-bot committed May 26, 2023
1 parent e0c3ca9 commit 35badc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pytorch3d/implicitron/models/overfit_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def forward(
self.implicit_function
]
if self.coarse_implicit_function is not None:
implicit_functions += [self.coarse_implicit_function]
implicit_functions = [self.coarse_implicit_function, self.implicit_function]

if self.global_encoder is not None:
global_code = self.global_encoder( # pyre-fixme[29]
Expand Down
6 changes: 3 additions & 3 deletions tests/implicitron/models/test_overfit_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ def test_overfit_model_vs_generic_model_with_batch_size_one(self):

# Adapt the mapping from generic model to overfit model
mapping_om_from_gm = {
key.replace("_implicit_functions.0._fn", "implicit_function").replace(
"_implicit_functions.1._fn", "coarse_implicit_function"
): val
key.replace(
"_implicit_functions.0._fn", "coarse_implicit_function"
).replace("_implicit_functions.1._fn", "implicit_function"): val
for key, val in generic_model.state_dict().items()
}
# Copy parameters from generic_model to overfit_model
Expand Down

0 comments on commit 35badc0

Please sign in to comment.