I think it is preferred to use torch.tensor instead of using torch.Tensor directly. Tho i’m not familiar with IPython image, but there must some way that can convert it into 2/3 D array that can be further use to create tensors. PS: look at the Docs 2 before asking  .