From 4c787604ad3f2e5f6bca3c170cdab84fb3051b12 Mon Sep 17 00:00:00 2001 From: haiping008 Date: Wed, 27 Mar 2019 16:05:51 -0500 Subject: [PATCH] tf.cosh, tf.floor, tf.greater, tf.greater_equal --- src/TensorFlowNET.Core/APIs/tf.math.cs | 42 +++++++++++++++++++ .../Operations/gen_array_ops.cs | 7 ---- .../Operations/gen_math_ops.cs | 28 +++++++++++++ 3 files changed, 70 insertions(+), 7 deletions(-) diff --git a/src/TensorFlowNET.Core/APIs/tf.math.cs b/src/TensorFlowNET.Core/APIs/tf.math.cs index 54bcf08b..111b92a7 100644 --- a/src/TensorFlowNET.Core/APIs/tf.math.cs +++ b/src/TensorFlowNET.Core/APIs/tf.math.cs @@ -63,6 +63,48 @@ namespace Tensorflow public static Tensor cos(Tensor x, string name = null) => gen_math_ops.cos(x, name); + /// + /// Computes hyperbolic cosine of x element-wise. + /// + /// + /// + /// + public static Tensor cosh(Tensor x, string name = null) + => gen_math_ops.cosh(x, name); + + /// + /// Returns element-wise largest integer not greater than x. + /// + /// + /// + /// + public static Tensor floor(Tensor x, string name = null) + => gen_math_ops.floor(x, name); + + /// + /// Returns the truth value of (x > y) element-wise. + /// + /// + /// + /// + /// + /// + /// + public static Tensor greater(Tx x, Ty y, string name = null) + => gen_math_ops.greater(x, y, name); + + /// + /// Returns the truth value of (x >= y) element-wise. + /// + /// + /// + /// + /// + /// + /// + public static Tensor greater_equal(Tx x, Ty y, string name = null) + => gen_math_ops.greater_equal(x, y, name); + /// /// Clips tensor values to a specified min and max. /// diff --git a/src/TensorFlowNET.Core/Operations/gen_array_ops.cs b/src/TensorFlowNET.Core/Operations/gen_array_ops.cs index 1d193a8a..6ce6f57f 100644 --- a/src/TensorFlowNET.Core/Operations/gen_array_ops.cs +++ b/src/TensorFlowNET.Core/Operations/gen_array_ops.cs @@ -26,13 +26,6 @@ namespace Tensorflow return _op.outputs[0]; } - public static Tensor greater(Tx x, Ty y, string name = null) - { - var _op = _op_def_lib._apply_op_helper("Greater", name: name, args: new { x, y }); - - return _op.outputs[0]; - } - public static Tensor less(Tx x, Ty y, string name = null) { var _op = _op_def_lib._apply_op_helper("Less", name: name, args: new { x, y }); diff --git a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs index ef7d5015..b2a72694 100644 --- a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs +++ b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs @@ -100,6 +100,20 @@ namespace Tensorflow return _op.outputs[0]; } + public static Tensor cosh(Tensor x, string name = null) + { + var _op = _op_def_lib._apply_op_helper("Cosh", name, args: new { x }); + + return _op.outputs[0]; + } + + public static Tensor floor(Tensor x, string name = null) + { + var _op = _op_def_lib._apply_op_helper("Floor", name, args: new { x }); + + return _op.outputs[0]; + } + public static Tensor _clip_by_value(Tensor t, Tensor clip_value_min, Tensor clip_value_max, string name = null) { var _op = _op_def_lib._apply_op_helper("ClipByValue", name, args: new { t, clip_value_min, clip_value_max }); @@ -107,6 +121,20 @@ namespace Tensorflow return _op.outputs[0]; } + public static Tensor greater(Tx x, Ty y, string name = null) + { + var _op = _op_def_lib._apply_op_helper("Greater", name: name, args: new { x, y }); + + return _op.outputs[0]; + } + + public static Tensor greater_equal(Tx x, Ty y, string name = null) + { + var _op = _op_def_lib._apply_op_helper("GreaterEqual", name: name, args: new { x, y }); + + return _op.outputs[0]; + } + public static Tensor squared_difference(Tensor x, Tensor y, string name = null) { var _op = _op_def_lib._apply_op_helper("SquaredDifference", name, args: new { x, y, name });