Skip to content

Commit 4481d19

Browse files
committed
implemented math_ops.square
1 parent 1597a0b commit 4481d19

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/TensorFlowNET.Core/Operations/gen_math_ops.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public static Tensor squared_difference(Tensor x, Tensor y, string name = null)
4848
return _op.outputs[0];
4949
}
5050

51+
public static Tensor square(Tensor x, string name = null)
52+
{
53+
var _op = _op_def_lib._apply_op_helper("Square", name, args: new { x });
54+
55+
return _op.outputs[0];
56+
}
57+
5158
public static Tensor cast(Tensor x, TF_DataType DstT, bool Truncate= false, string name= "")
5259
{
5360
var _op = _op_def_lib._apply_op_helper("Cast", name, args: new { x, DstT, Truncate });

src/TensorFlowNET.Core/Operations/math_ops.py.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static Tensor square_difference(Tensor x, Tensor y, string name = null)
5757

5858
public static Tensor square(Tensor x, string name = null)
5959
{
60-
throw new NotImplementedException();
60+
return gen_math_ops.square(x, name);
6161
}
6262

6363
/// <summary>

0 commit comments

Comments
 (0)