From f10a72f74763c703909fc3a598bff5daa3f7140d Mon Sep 17 00:00:00 2001 From: dogvane Date: Sun, 1 Mar 2020 20:33:17 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=87=8F=E6=B3=95=E8=BF=90=E7=AE=97=E5=87=BD=E6=95=B0=202.=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=80=E4=B8=AA=E7=BC=BA=E5=B0=91=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E5=A4=84=E7=90=86=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/TensorFlowNET.Core/APIs/tf.math.cs | 23 +++++++++++++++++-- .../Sessions/_FetchHandler.cs | 3 +++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/TensorFlowNET.Core/APIs/tf.math.cs b/src/TensorFlowNET.Core/APIs/tf.math.cs index a28ec9d3..6e093cb6 100644 --- a/src/TensorFlowNET.Core/APIs/tf.math.cs +++ b/src/TensorFlowNET.Core/APIs/tf.math.cs @@ -269,6 +269,16 @@ namespace Tensorflow public Tensor subtract(Tensor x, T[] y, string name = null) where T : struct => gen_math_ops.sub(x, ops.convert_to_tensor(y, dtype: x.dtype.as_base_dtype(), name: "y"), name); + /// + /// return x - y + /// + /// + /// + /// + /// + public Tensor subtract(Tensor x, Tensor y, string name = null) + => gen_math_ops.sub(x, y, name); + public Tensor log(Tensor x, string name = null) => gen_math_ops.log(x, name); @@ -335,8 +345,17 @@ namespace Tensorflow public Tensor minimum(T1 x, T2 y, string name = null) => gen_math_ops.minimum(x, y, name: name); - public Tensor multiply(Tx x, Ty y) - => gen_math_ops.mul(x, y); + /// + /// return x * y + /// + /// + /// + /// + /// + /// + /// + public Tensor multiply(Tx x, Ty y, string name = null) + => gen_math_ops.mul(x, y, name: name); public Tensor negative(Tensor x, string name = null) => gen_math_ops.neg(x, name); diff --git a/src/TensorFlowNET.Core/Sessions/_FetchHandler.cs b/src/TensorFlowNET.Core/Sessions/_FetchHandler.cs index 79692798..84cae247 100644 --- a/src/TensorFlowNET.Core/Sessions/_FetchHandler.cs +++ b/src/TensorFlowNET.Core/Sessions/_FetchHandler.cs @@ -80,6 +80,9 @@ namespace Tensorflow case NPTypeCode.Single: full_values.Add(float.NaN); break; + case NPTypeCode.Double: + full_values.Add(float.NaN); + break; case NPTypeCode.String: full_values.Add(float.NaN); break;