PyTorch Create a tensor with given data

To create a tensor with given input data/values we can use the following code:

my_tensor = torch.Tensor(my_data)

Complete code to test it:

import torch

my_data = [[0.1051, 0.0710],
           [0.5582, 0.7901],
           [0.2262, 0.2459]]

my_tensor = torch.Tensor(my_data)
print(my_tensor)

Above, my_data is the given data with which created a tensor.