torch.atan2#
- torch.atan2(input:Tensor,other:Tensor,*,out:Optional[Tensor])→Tensor#
Element-wise arctangent ofwith consideration of the quadrant. Returns a new tensor with the signed anglesin radians between vectorand vector. (Note that, the secondparameter, is the x-coordinate, while, the firstparameter, is the y-coordinate.)
The shapes of
inputandothermust bebroadcastable.- Parameters
- Keyword Arguments
out (Tensor,optional) – the output tensor.
Example:
>>>a=torch.randn(4)>>>atensor([ 0.9041, 0.0196, -0.3108, -2.4423])>>>torch.atan2(a,torch.randn(4))tensor([ 0.9833, 0.0811, -1.9743, -1.4151])