Here are several ways to construct a new Tensor.

Subsections

  1. torch.Tensor()
  2. torch.Tensor(tensor)
  3. torch.Tensor(sz1 [,sz2 [,sz3 [,sz4]]]])
  4. torch.Tensor(sizes, [strides])
  5. torch.Tensor(storage, storageOffset, sizes, [strides])
  6. torch.Tensor(storage, storageOffset, sz1 [, st1 ... [, sz4 [, st4]]])