PyTorch torch.t Function
Pytorch torch Reference Manual
torch.tis a function in PyTorch used for transposing two-dimensional tensors.
Function Definition
torch.t(input)
Usage Example
Example
import torch
x = torch.randn(3, 4)
y = torch.t(x)
print("Original shape:", x.shape)
print("Transposed:", y.shape)
x = torch.randn(3, 4)
y = torch.t(x)
print("Original shape:", x.shape)
print("Transposed:", y.shape)
Other Extensions