Browse Source

tf.ceil, tf._clip_by_value, tf.cos

tags/v0.9
Oceania2018 6 years ago
parent
commit
0f14ec000f
2 changed files with 50 additions and 0 deletions
  1. +29
    -0
      src/TensorFlowNET.Core/APIs/tf.math.cs
  2. +21
    -0
      src/TensorFlowNET.Core/Operations/gen_math_ops.cs

+ 29
- 0
src/TensorFlowNET.Core/APIs/tf.math.cs View File

@@ -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);

/// <summary>
/// Returns element-wise smallest integer not less than x.
/// </summary>
/// <param name="x"></param>
/// <param name="name"></param>
/// <returns></returns>
public static Tensor ceil(Tensor x, string name = null)
=> gen_math_ops.ceil(x, name);

/// <summary>
/// Computes cos of x element-wise.
/// </summary>
/// <param name="x"></param>
/// <param name="name"></param>
/// <returns></returns>
public static Tensor cos(Tensor x, string name = null)
=> gen_math_ops.cos(x, name);

/// <summary>
/// Clips tensor values to a specified min and max.
/// </summary>
/// <param name="t"></param>
/// <param name="clip_value_min"></param>
/// <param name="clip_value_max"></param>
/// <param name="name"></param>
/// <returns></returns>
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);



+ 21
- 0
src/TensorFlowNET.Core/Operations/gen_math_ops.cs View File

@@ -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 });


Loading…
Cancel
Save