From 301a4271aa1d974b391660d0c39ba734824d4af8 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Wed, 27 Mar 2019 02:51:25 -0500 Subject: [PATCH] add tf.atan2 --- src/TensorFlowNET.Core/APIs/tf.math.cs | 10 ++++++++++ src/TensorFlowNET.Core/Operations/gen_math_ops.cs | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/src/TensorFlowNET.Core/APIs/tf.math.cs b/src/TensorFlowNET.Core/APIs/tf.math.cs index ca047fdd..bb665082 100644 --- a/src/TensorFlowNET.Core/APIs/tf.math.cs +++ b/src/TensorFlowNET.Core/APIs/tf.math.cs @@ -60,6 +60,16 @@ namespace Tensorflow public static Tensor equal(Tensor x, Tensor y, string name = null) => gen_math_ops.equal(x, y, name); + /// + /// Computes arctangent of `y/x` element-wise, respecting signs of the arguments. + /// + /// + /// + /// + /// + public static Tensor atan2(Tensor y, Tensor x, string name = null) + => gen_math_ops.atan2(y, x, name); + public static Tensor multiply(Tensor x, Tensor y) => gen_math_ops.mul(x, y); diff --git a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs index 03cbee13..f5fbb772 100644 --- a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs +++ b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs @@ -187,6 +187,13 @@ namespace Tensorflow return _op.outputs[0]; } + public static Tensor atan2(Tensor y, Tensor x, string name = null) + { + var _op = _op_def_lib._apply_op_helper("Atan2", name, args: new { y, x }); + + return _op.outputs[0]; + } + public static Tensor mul(Tensor x, Tensor y, string name = null) { var _op = _op_def_lib._apply_op_helper("Mul", name, args: new { x, y });