Skip to content

Commit

Permalink
Apply bugfix from B1ueber2y#4
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshshrestha31 committed Feb 18, 2022
1 parent 57d8424 commit 708d545
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/utils/decoder_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def decode_sdf_gradient(decoder, latent_vector, points, clamp_dist=0.1, MAX_POIN
points_batch = points[start:end]
sdf = decode_sdf(decoder, latent_vector, points_batch, clamp_dist=clamp_dist)
start = end
grad_tensor = torch.autograd.grad(outputs=sdf, inputs=points_batch, grad_outputs=torch.ones_like(points_batch), create_graph=True, retain_graph=True)
# grad_tensor = torch.autograd.grad(outputs=sdf, inputs=points_batch, grad_outputs=torch.ones_like(points_batch), create_graph=True, retain_graph=True)
grad_tensor = torch.autograd.grad(outputs=sdf, inputs=points_batch, grad_outputs=torch.ones_like(sdf), create_graph=True, retain_graph=True)
grad_tensor = grad_tensor[0]
if no_grad:
grad_tensor = grad_tensor.detach()
Expand Down

0 comments on commit 708d545

Please sign in to comment.