Hi M!



 MUnique:

I want it to be fully implemented in Pytorch to be able to do backpropagation.


If your two-dimensional (HxW) Gaussian window is going to be fixed,
i.e., something like [1.0, 2.0, 1.0] (in 1-d) that doesn’t depend on the
values in the tensor you want to multiply it with, then where those fixed
values came from won’t affect back-propagation.  So from_numpy (...)
will be fine.
The point is that in back-propagation you won’t be differentiating
with respect to the constants in your Gaussian window; you’ll be
differentiating with respect to variables (elements of tensors that
have requires_grad = True) that those constants multiply.
Best.
K. Frank