how to use pytorch 1.Tensor we can create a tensor just like creating a matrix the default type of a tensor is float import torch as t a = t.Tensor([[1,2],[3,4],[5,6]]) a tensor([[1., 2.], [3., 4.], [5., 6.]]) we can also change the datatype of a ten…