Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grad of all-zero flow #11

Open
askerlee opened this issue May 3, 2022 · 2 comments
Open

Grad of all-zero flow #11

askerlee opened this issue May 3, 2022 · 2 comments

Comments

@askerlee
Copy link

askerlee commented May 3, 2022

In the simplest case, if the flow is a zero tensor, all source elements are copied to the same position in the target tensor. If flow changes slightly, the target tensor will also change, that means the flow gradient is non-zero.
However, this test code shows otherwise:

from Forward_Warp import forward_warp
import torch

a = torch.randn(1,1,5,5)
flow = torch.zeros(1,5,5,2, requires_grad=True)
fwarp = forward_warp()
b =fwarp(a, flow)
b.sum().backward()
print(flow.grad)
# flow.grad is an all-zero tensor.

Any idea what's the issue? Thanks.

@askerlee askerlee changed the title All-zero grad of flow Grad of all-zero flow May 3, 2022
@askerlee
Copy link
Author

askerlee commented May 3, 2022

I also tried to use random flow, and flow.grad is still all-zero. This seems quite weird.

Repository owner deleted a comment from LeonardoWlopes Feb 23, 2024
@askerlee
Copy link
Author

Phishing attack. I've reported to github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant