How to put tensor on a custom Function to cuda device?

Here is an answer, that might work for you.
You should create Tensor from NumPy array and then transfer it to device