From 41d4e84b75fa7ab06c047943948d12d52e163df8 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Thu, 4 Apr 2019 21:01:29 -0500 Subject: [PATCH] tf.sin, tf.sinh, tf.sum, tf.tan, tf.tanh --- src/TensorFlowNET.Core/APIs/tf.math.cs | 27 ++++++++++++++++++ .../Operations/gen_math_ops.cs | 28 +++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/src/TensorFlowNET.Core/APIs/tf.math.cs b/src/TensorFlowNET.Core/APIs/tf.math.cs index 6ee90749..bbf240e3 100644 --- a/src/TensorFlowNET.Core/APIs/tf.math.cs +++ b/src/TensorFlowNET.Core/APIs/tf.math.cs @@ -54,6 +54,24 @@ namespace Tensorflow public static Tensor ceil(Tensor x, string name = null) => gen_math_ops.ceil(x, name); + /// + /// Computes sin of x element-wise. + /// + /// + /// + /// + public static Tensor sin(Tensor x, string name = null) + => gen_math_ops.sin(x, name); + + /// + /// Computes hyperbolic sine of x element-wise. + /// + /// + /// + /// + public static Tensor sinh(Tensor x, string name = null) + => gen_math_ops.sinh(x, name); + /// /// Computes cos of x element-wise. /// @@ -72,6 +90,12 @@ namespace Tensorflow public static Tensor cosh(Tensor x, string name = null) => gen_math_ops.cosh(x, name); + public static Tensor tan(Tensor x, string name = null) + => gen_math_ops.tan(x, name); + + public static Tensor tanh(Tensor x, string name = null) + => gen_math_ops.tanh(x, name); + /// /// Returns element-wise largest integer not greater than x. /// @@ -257,6 +281,9 @@ namespace Tensorflow return math_ops.reduce_sum(input, axis); } + public static Tensor sum(Tensor input, int axis, bool keep_dims = false, string name = null) + => gen_math_ops._sum(input, axis, keep_dims: keep_dims, name: name); + public static Tensor reduce_mean(Tensor input_tensor, int[] axis = null, bool keepdims = false, string name = null, int? reduction_indices = null) => math_ops.reduce_mean(input_tensor, axis: axis, keepdims: keepdims, name: name, reduction_indices: reduction_indices); diff --git a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs index 25ae46ed..c562586a 100644 --- a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs +++ b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs @@ -101,6 +101,20 @@ namespace Tensorflow return _op.outputs[0]; } + public static Tensor sin(Tensor x, string name = null) + { + var _op = _op_def_lib._apply_op_helper("Sin", name, args: new { x }); + + return _op.outputs[0]; + } + + public static Tensor sinh(Tensor x, string name = null) + { + var _op = _op_def_lib._apply_op_helper("Sinh", name, args: new { x }); + + return _op.outputs[0]; + } + public static Tensor cos(Tensor x, string name = null) { var _op = _op_def_lib._apply_op_helper("Cos", name, args: new { x }); @@ -115,6 +129,20 @@ namespace Tensorflow return _op.outputs[0]; } + public static Tensor tan(Tensor x, string name = null) + { + var _op = _op_def_lib._apply_op_helper("Tan", name, args: new { x }); + + return _op.outputs[0]; + } + + public static Tensor tanh(Tensor x, string name = null) + { + var _op = _op_def_lib._apply_op_helper("Tanh", 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 });