# Tag Archives: Python-PyTorch

In this article, we will see how to move a tensor from CPU to GPU and from GPU to CPU in Python. Why do we… Read More
In this article, we are going to discuss how to compute the pseudoinverse of a matrix in Python using PyTorch. torch.linalg.pinv() method torch.linalg.pinv() method accepts… Read More
In this article, we will discuss how to invert the colors of an image randomly with a given probability in Python using PyTorch. RandomInvert() method… Read More
In this article, we are going to cover how to compute the error function of a tensor in Python using PyTorch. torch.special.erf() method We can… Read More
In this article, we will discuss how to compute the Cosine Similarity between two tensors in Python using PyTorch. The vector size should be the… Read More
In this article, we are going to see how to check if a tensor is contiguous or not in PyTorch. A contiguous tensor could be… Read More
In this article, we will discuss how to compute the pairwise distance between two vectors in PyTorch.  The vector size should be the same and… Read More
In this article, we are going to discuss how to get the rank of a matrix in PyTorch. we can get the rank of a… Read More
In this article, we are going to discuss how to compute the element-wise entropy of an input tensor in PyTorch, we can compute this by… Read More
In this article, we are going to see how to rotate an image by an angle in PyTorch. To achieve this, we can use RandomRotation()… Read More
In this article, we are going to cover how to compute the inverse of a square matrix in PyTorch.  torch.linalg.inv() method we can compute the… Read More
In this article, we are going to see how to draw bounding boxes on an image in PyTorch. draw_bounding_boxes() method The draw_bounding_boxes function helps us… Read More
In this article, we will Understand PyTorch Activation Functions.  What is an activation function and why to use them? Activation functions are the building blocks… Read More
In this article, we are going to see how to convert an image to grayscale in PyTorch.  torchvision.transforms.grayscale method Grayscaling is the process of converting… Read More