Hi,
I custom a Function, in forward method. I have a numpy array x and a cuda tensor input.How to copy value of x to input tensor ? I have try, in forward method, torch.to(device) don’t work.
Thanks
class MyFunction(torch.autograd.Function):

    @staticmethod
    def forward(ctx, input):
        x = np.zeros(shape)
        # do something for x
        # and how to copy data of x to gpu tensor input
        
        return ...

    @staticmethod
    def backward(ctx, grad_output):
          '''