Browse Source

tf.cosh, tf.floor, tf.greater, tf.greater_equal

tags/v0.9
haiping008 6 years ago
parent
commit
4c787604ad
3 changed files with 70 additions and 7 deletions
  1. +42
    -0
      src/TensorFlowNET.Core/APIs/tf.math.cs
  2. +0
    -7
      src/TensorFlowNET.Core/Operations/gen_array_ops.cs
  3. +28
    -0
      src/TensorFlowNET.Core/Operations/gen_math_ops.cs

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

@@ -63,6 +63,48 @@ namespace Tensorflow
public static Tensor cos(Tensor x, string name = null) public static Tensor cos(Tensor x, string name = null)
=> gen_math_ops.cos(x, name); => gen_math_ops.cos(x, name);


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

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

/// <summary>
/// Returns the truth value of (x > y) element-wise.
/// </summary>
/// <typeparam name="Tx"></typeparam>
/// <typeparam name="Ty"></typeparam>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="name"></param>
/// <returns></returns>
public static Tensor greater<Tx, Ty>(Tx x, Ty y, string name = null)
=> gen_math_ops.greater(x, y, name);

/// <summary>
/// Returns the truth value of (x >= y) element-wise.
/// </summary>
/// <typeparam name="Tx"></typeparam>
/// <typeparam name="Ty"></typeparam>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="name"></param>
/// <returns></returns>
public static Tensor greater_equal<Tx, Ty>(Tx x, Ty y, string name = null)
=> gen_math_ops.greater_equal(x, y, name);

/// <summary> /// <summary>
/// Clips tensor values to a specified min and max. /// Clips tensor values to a specified min and max.
/// </summary> /// </summary>


+ 0
- 7
src/TensorFlowNET.Core/Operations/gen_array_ops.cs View File

@@ -26,13 +26,6 @@ namespace Tensorflow
return _op.outputs[0]; return _op.outputs[0];
} }


public static Tensor greater<Tx, Ty>(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, Ty>(Tx x, Ty y, string name = null) public static Tensor less<Tx, Ty>(Tx x, Ty y, string name = null)
{ {
var _op = _op_def_lib._apply_op_helper("Less", name: name, args: new { x, y }); var _op = _op_def_lib._apply_op_helper("Less", name: name, args: new { x, y });


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

@@ -100,6 +100,20 @@ namespace Tensorflow
return _op.outputs[0]; 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) 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 }); 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]; return _op.outputs[0];
} }
public static Tensor greater<Tx, Ty>(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, Ty>(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) 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 }); var _op = _op_def_lib._apply_op_helper("SquaredDifference", name, args: new { x, y, name });


Loading…
Cancel
Save