diff --git a/src/TensorFlowNET.Core/APIs/tf.math.cs b/src/TensorFlowNET.Core/APIs/tf.math.cs index 24d382ec..741b4ccb 100644 --- a/src/TensorFlowNET.Core/APIs/tf.math.cs +++ b/src/TensorFlowNET.Core/APIs/tf.math.cs @@ -11,6 +11,11 @@ namespace Tensorflow return gen_math_ops.add(a, b); } + public static unsafe Tensor sub(Tensor a, Tensor b) + { + return gen_math_ops.sub(a, b); + } + public static unsafe Tensor add(Tensor a, RefVariable b) { return gen_math_ops.add(a, b); diff --git a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs index f1706311..938c954e 100644 --- a/src/TensorFlowNET.Core/Operations/gen_math_ops.cs +++ b/src/TensorFlowNET.Core/Operations/gen_math_ops.cs @@ -9,11 +9,11 @@ namespace Tensorflow { public static OpDefLibrary _op_def_lib = new OpDefLibrary(); - public static Tensor add(Tensor a, Tensor b) + public static Tensor add(Tensor x, Tensor y) { var keywords = new Dictionary(); - keywords.Add("x", a); - keywords.Add("y", b); + keywords.Add("x", x); + keywords.Add("y", y); var _op = _op_def_lib._apply_op_helper("Add", name: "add", keywords: keywords); @@ -31,6 +31,17 @@ namespace Tensorflow return new Tensor(_op, 0, _op.OutputType(0)); } + public static Tensor sub(Tensor x, Tensor y) + { + var keywords = new Dictionary(); + keywords.Add("x", x); + keywords.Add("y", y); + + var _op = _op_def_lib._apply_op_helper("Sub", name: "sub", keywords: keywords); + + return new Tensor(_op, 0, _op.OutputType(0)); + } + public static Tensor mul(Tensor x, Tensor y) { var keywords = new Dictionary();