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

why ignore the grad of dir(mean) in SphericalHarmonicFunc? #1

Open
archershot opened this issue Dec 15, 2024 · 0 comments
Open

why ignore the grad of dir(mean) in SphericalHarmonicFunc? #1

archershot opened this issue Dec 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@archershot
Copy link

class SphericalHarmonicFunc(torch.autograd.Function):
@staticmethod
def forward(ctx,deg:int, sh_base:torch.Tensor,sh_rest:torch.Tensor, dirs:torch.Tensor):
ctx.save_for_backward(dirs)
ctx.degree=deg
ctx.sh_rest_dim=sh_rest.shape[0]
rgb=torch.ops.RasterBinning.sh2rgb_forward(deg,sh_base,sh_rest,dirs)
return rgb
@staticmethod
def backward(ctx, grad_rgb):
(dirs,)=ctx.saved_tensors
degree=ctx.degree
sh_rest_dim=ctx.sh_rest_dim
sh_base_grad,sh_reset_grad=torch.ops.RasterBinning.sh2rgb_backward(degree,grad_rgb,sh_rest_dim,dirs)
return None,sh_base_grad,sh_reset_grad,None

@KaiminLiao KaiminLiao added the bug Something isn't working label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants