diff --git a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs index e3b8022a..3210c742 100644 --- a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs +++ b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs @@ -48,6 +48,13 @@ namespace Tensorflow return _op.outputs[0]; } + public static Tensor square(Tensor x, string name = null) + { + var _op = _op_def_lib._apply_op_helper("Square", name, args: new { x }); + + return _op.outputs[0]; + } + public static Tensor cast(Tensor x, TF_DataType DstT, bool Truncate= false, string name= "") { var _op = _op_def_lib._apply_op_helper("Cast", name, args: new { x, DstT, Truncate }); diff --git a/src/TensorFlowNET.Core/Operations/math_ops.py.cs b/src/TensorFlowNET.Core/Operations/math_ops.py.cs index d6b17509..a114234a 100644 --- a/src/TensorFlowNET.Core/Operations/math_ops.py.cs +++ b/src/TensorFlowNET.Core/Operations/math_ops.py.cs @@ -57,7 +57,7 @@ namespace Tensorflow public static Tensor square(Tensor x, string name = null) { - throw new NotImplementedException(); + return gen_math_ops.square(x, name); } ///