Cast a Tensor to another Type in PyTorch

We can cast a Tensor to another type in PyTorch as below:

import torch
# Create a float tensor
y = torch.randn(5, 5)
# Cast the flost tensor to int tensor in pytorch
y = y.int()

Cast a Tensor to another Type in PyTorch

Neural Network Machine Learning Algorithm From Scratch in Python is a short video course to discuss an overview of the Neural Network Deep Learning Algorithm. In this video different concepts related to Neural Network Algorithm such as Dot Product of Matrix, Sigmoid, Sigmoid Derivative, Forward Propagation, Back Propagation is discussed in detail. Also, the model loss and model weights update is discussed. Finally, the algorithm is implemented, step by step, in Python Programming language using Jupyter.

Neural Network Machine Learning Algorithm From Scratch in Python

Cheers !!

Leave a Reply

%d bloggers like this: