Hi,
I have a tenor of a shape (n,m,2), I would like to perform an operation (a rotation) on the last dimension.
That operation depends on a leaf variable that should be backpropagated. I am using the below code but the theta is getting a gradient of None.
        left_rotation = torch.tensor([torch.cos(self.theta), -torch.sin(self.theta)])
        left = (aligned_grid * left_rotation).sum(dim=2).pow(2) / self.alpha.pow(2)
        # Do more things with the "left" variable

The intent here is to broadcast the value of torch.cos(self.theta), -torch.sin(self.theta) on the last dimension.
What would be the proper way to go about this?
Thanks a lot for helping