From 0f14ec000fe90b479e60fd83d1c7ba22e0a15ca3 Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Wed, 27 Mar 2019 05:02:25 -0500 Subject: [PATCH] tf.ceil, tf._clip_by_value, tf.cos --- src/TensorFlowNET.Core/APIs/tf.math.cs | 29 +++++++++++++++++++ .../Operations/gen_math_ops.cs | 21 ++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/src/TensorFlowNET.Core/APIs/tf.math.cs b/src/TensorFlowNET.Core/APIs/tf.math.cs index bb665082..54bcf08b 100644 --- a/src/TensorFlowNET.Core/APIs/tf.math.cs +++ b/src/TensorFlowNET.Core/APIs/tf.math.cs @@ -45,6 +45,35 @@ namespace Tensorflow public static Tensor arg_min(Tensor input, int dimension, TF_DataType output_type = TF_DataType.TF_INT64, string name = null) => gen_math_ops.arg_min(input, dimension, output_type: output_type, name: name); + /// + /// Returns element-wise smallest integer not less than x. + /// + /// + /// + /// + public static Tensor ceil(Tensor x, string name = null) + => gen_math_ops.ceil(x, name); + + /// + /// Computes cos of x element-wise. + /// + /// + /// + /// + public static Tensor cos(Tensor x, string name = null) + => gen_math_ops.cos(x, name); + + /// + /// Clips tensor values to a specified min and max. + /// + /// + /// + /// + /// + /// + public static Tensor _clip_by_value(Tensor t, Tensor clip_value_min, Tensor clip_value_max, string name = null) + => gen_math_ops._clip_by_value(t, clip_value_min, clip_value_max); + public static Tensor sub(Tensor a, Tensor b) => gen_math_ops.sub(a, b); diff --git a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs index f5fbb772..ef7d5015 100644 --- a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs +++ b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs @@ -86,6 +86,27 @@ namespace Tensorflow return _op.outputs[0]; } + public static Tensor ceil(Tensor x, string name = null) + { + var _op = _op_def_lib._apply_op_helper("Ceil", 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 }); + + 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 }); + + 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 });