Skip to content

Commit 4c78760

Browse files
committed
tf.cosh, tf.floor, tf.greater, tf.greater_equal
1 parent 2f29995 commit 4c78760

3 files changed

Lines changed: 70 additions & 7 deletions

File tree

src/TensorFlowNET.Core/APIs/tf.math.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,48 @@ public static Tensor ceil(Tensor x, string name = null)
6363
public static Tensor cos(Tensor x, string name = null)
6464
=> gen_math_ops.cos(x, name);
6565

66+
/// <summary>
67+
/// Computes hyperbolic cosine of x element-wise.
68+
/// </summary>
69+
/// <param name="x"></param>
70+
/// <param name="name"></param>
71+
/// <returns></returns>
72+
public static Tensor cosh(Tensor x, string name = null)
73+
=> gen_math_ops.cosh(x, name);
74+
75+
/// <summary>
76+
/// Returns element-wise largest integer not greater than x.
77+
/// </summary>
78+
/// <param name="x"></param>
79+
/// <param name="name"></param>
80+
/// <returns></returns>
81+
public static Tensor floor(Tensor x, string name = null)
82+
=> gen_math_ops.floor(x, name);
83+
84+
/// <summary>
85+
/// Returns the truth value of (x > y) element-wise.
86+
/// </summary>
87+
/// <typeparam name="Tx"></typeparam>
88+
/// <typeparam name="Ty"></typeparam>
89+
/// <param name="x"></param>
90+
/// <param name="y"></param>
91+
/// <param name="name"></param>
92+
/// <returns></returns>
93+
public static Tensor greater<Tx, Ty>(Tx x, Ty y, string name = null)
94+
=> gen_math_ops.greater(x, y, name);
95+
96+
/// <summary>
97+
/// Returns the truth value of (x >= y) element-wise.
98+
/// </summary>
99+
/// <typeparam name="Tx"></typeparam>
100+
/// <typeparam name="Ty"></typeparam>
101+
/// <param name="x"></param>
102+
/// <param name="y"></param>
103+
/// <param name="name"></param>
104+
/// <returns></returns>
105+
public static Tensor greater_equal<Tx, Ty>(Tx x, Ty y, string name = null)
106+
=> gen_math_ops.greater_equal(x, y, name);
107+
66108
/// <summary>
67109
/// Clips tensor values to a specified min and max.
68110
/// </summary>

src/TensorFlowNET.Core/Operations/gen_array_ops.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@ public static Tensor gather_v2(Tensor @params, Tensor indices, int axis, string
2626
return _op.outputs[0];
2727
}
2828

29-
public static Tensor greater<Tx, Ty>(Tx x, Ty y, string name = null)
30-
{
31-
var _op = _op_def_lib._apply_op_helper("Greater", name: name, args: new { x, y });
32-
33-
return _op.outputs[0];
34-
}
35-
3629
public static Tensor less<Tx, Ty>(Tx x, Ty y, string name = null)
3730
{
3831
var _op = _op_def_lib._apply_op_helper("Less", name: name, args: new { x, y });

src/TensorFlowNET.Core/Operations/gen_math_ops.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,41 @@ public static Tensor cos(Tensor x, string name = null)
100100
return _op.outputs[0];
101101
}
102102

103+
public static Tensor cosh(Tensor x, string name = null)
104+
{
105+
var _op = _op_def_lib._apply_op_helper("Cosh", name, args: new { x });
106+
107+
return _op.outputs[0];
108+
}
109+
110+
public static Tensor floor(Tensor x, string name = null)
111+
{
112+
var _op = _op_def_lib._apply_op_helper("Floor", name, args: new { x });
113+
114+
return _op.outputs[0];
115+
}
116+
103117
public static Tensor _clip_by_value(Tensor t, Tensor clip_value_min, Tensor clip_value_max, string name = null)
104118
{
105119
var _op = _op_def_lib._apply_op_helper("ClipByValue", name, args: new { t, clip_value_min, clip_value_max });
106120

107121
return _op.outputs[0];
108122
}
109123

124+
public static Tensor greater<Tx, Ty>(Tx x, Ty y, string name = null)
125+
{
126+
var _op = _op_def_lib._apply_op_helper("Greater", name: name, args: new { x, y });
127+
128+
return _op.outputs[0];
129+
}
130+
131+
public static Tensor greater_equal<Tx, Ty>(Tx x, Ty y, string name = null)
132+
{
133+
var _op = _op_def_lib._apply_op_helper("GreaterEqual", name: name, args: new { x, y });
134+
135+
return _op.outputs[0];
136+
}
137+
110138
public static Tensor squared_difference(Tensor x, Tensor y, string name = null)
111139
{
112140
var _op = _op_def_lib._apply_op_helper("SquaredDifference", name, args: new { x, y, name });

0 commit comments

Comments
 (0)