YouTip LogoYouTip

Pytorch Torch Cos

# PyTorch torch.cos Function * * Pytorch torch Reference Manual](#) `torch.cos` is a function in PyTorch used to compute the element-wise cosine. ### Function Definition torch.cos(input, out=None) * * * ## Usage Example ## Example import torch x = torch.tensor([0, torch.pi/2, torch.pi,3*torch.pi/2]) print(torch.cos(x)) The output result is: tensor([ 1.0000e+00, -8.7423e-08, -1.0000e+00, -8.7423e-08]) * * Pytorch torch Reference Manual](#)
← Pytorch Torch Count_NonzeroPytorch Torch Copysign β†’