From 821964d96fdf98dcceb2e0759c3419f977fabe93 Mon Sep 17 00:00:00 2001 From: Frans Zdyb Date: Mon, 2 Sep 2024 16:43:14 +0200 Subject: [PATCH] Replace inplace division Inplace division causes an error during gradient computation. --- mp_nerf/massive_pnerf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mp_nerf/massive_pnerf.py b/mp_nerf/massive_pnerf.py index cf0d43d..2d7ee73 100644 --- a/mp_nerf/massive_pnerf.py +++ b/mp_nerf/massive_pnerf.py @@ -55,7 +55,7 @@ def mp_nerf_torch(a, b, c, l, theta, chi): n_plane = torch.cross(ba, cb, dim=-1) n_plane_ = torch.cross(n_plane, cb, dim=-1) rotate = torch.stack([cb, n_plane_, n_plane], dim=-1) - rotate /= torch.norm(rotate, dim=-2, keepdim=True) + rotate = rotate / torch.norm(rotate, dim=-2, keepdim=True) # calc proto point, rotate. add (-1 for sidechainnet convention) # https://github.com/jonathanking/sidechainnet/issues/14 d = torch.stack([-torch.cos(theta),