tensor from numpy code example
Example 1: convert numpy to torch
torch.from_numpy(your_array)
Example 2: tf tensor from numpy
tf.convert_to_tensor(my_np_array, dtype=tf.float32)
Example 3: tensor.numpy() pytorch gpu
tensor_array.cpu().detach().numpy()