Browse Source

tf.sin, tf.sinh, tf.sum, tf.tan, tf.tanh

tags/v0.9
Oceania2018 6 years ago
parent
commit
41d4e84b75
2 changed files with 55 additions and 0 deletions
  1. +27
    -0
      src/TensorFlowNET.Core/APIs/tf.math.cs
  2. +28
    -0
      src/TensorFlowNET.Core/Operations/gen_math_ops.cs

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

@@ -54,6 +54,24 @@ namespace Tensorflow
public static Tensor ceil(Tensor x, string name = null)
=> gen_math_ops.ceil(x, name);

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

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

/// <summary>
/// Computes cos of x element-wise.
/// </summary>
@@ -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);

/// <summary>
/// Returns element-wise largest integer not greater than x.
/// </summary>
@@ -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);



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

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


Loading…
Cancel
Save