Similar to numpy where exist multi-dimensional array, the pytorch tensorflow are build up of tensors.
ever heard of it. Let’s begin.
- They are same as numpy arrays except that they have flexibility to run in GPU.
- FloatTensor: 32-bit float
- DoubleTensor: 64-bit float
- HalfTensor: 16-bit float
- IntTensor: 32-bit int
- LongTensor: 64-bit int
some basic functions
- torch.mm() <matrix multiplication>
# converting the numpy array to tensor
- tensor = torch.from_numpy(a)
In next section lets discuss more about the common pytorch Modules… part 3 .