Table of Contents
Shortcuts

# torch.atan2

torch.atan2(input, other, *, out=None) → Tensor

  Element-wise arctangent of input i/other i\text{input}_{i} / \text{other}_{i}input i​/other i​ with consideration of the quadrant. Returns a new tensor with the signed angles in radians between vector (other i,input i)(\text{other}_{i}, \text{input}_{i})(other i​,input i​) and vector (1,0)(1, 0)(1,0). (Note that other i\text{other}_{i}other i​, the second parameter, is the x-coordinate, while input i\text{input}_{i}input i​, the first parameter, is the y-coordinate.)

  The shapes of `input` and `other` must be broadcastable.

  Parameters:

    - input (Tensor) – the first input tensor

    - other (Tensor) – the second input tensor

  Keyword Arguments:

    out (Tensor, optional) – the output tensor.

  Example:

      >>> a = torch.randn(4)
      >>> a
      tensor([ 0.9041,  0.0196, -0.3108, -2.4423])
      >>> torch.atan2(a, torch.randn(4))
      tensor([ 0.9833,  0.0811, -1.9743, -1.4151])

## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

## Resources

Find development resources and get your questions answered

View Resources

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.