Numpy and pytorch backpropagation

Hello everyone,

I have a question regarding backpropagation. If I have a tensor X that I’m using for backpropagation, and there’s a constant c, if during an operation I compute np.sqrt (c) × X , will this cause any issue with the backpropagation process?

Thanks in advance,

I assume you are wrapping this numpy * torch operation into torch.compile which will translate it to pure PyTorch ops? If so, multiplying with a constant won’t cause any issues during the backpropagation.