tf.raw_ops.Atan2
Вычисляет арктангенс y/x поэлементно, учитывая знаки аргументов.
tf.raw_ops.Atan2(
y, x, name=None
)
Это угол \( \theta \in [-\pi, \pi] \) такой, что \[ x = r \cos(\theta) \] и \[ y = r \sin(\theta) \] где \(r = \sqrt{x^2 + y^2} \).
Например:
x = [1., 1.] y = [1., -1.] print((tf.math.atan2(y,x) * (180 / np.pi)).numpy()) [ 45. -45.]
| Аргументы | |
|---|---|
y | A Tensor. Должен быть одного из следующих типов: bfloat16, half, float32, float64. |
x | A Tensor. Должен иметь тот же тип, что и y. |
name | Имя операции (необязательно). |
| Возвращаемое значение | |
|---|---|
A Tensor. Имеет тот же тип, что и y. |
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.9/api_docs/python/tf/raw_ops/Atan2