From 5f217f1b18cc7aaf599470481ef4590cb583d9af Mon Sep 17 00:00:00 2001 From: Banyc <36535895+Banyc@users.noreply.github.com> Date: Sun, 13 Dec 2020 00:28:31 +0800 Subject: [PATCH] Better error message for Tensor.assign --- src/TensorFlowNET.Core/Tensors/Tensor.Assign.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/TensorFlowNET.Core/Tensors/Tensor.Assign.cs b/src/TensorFlowNET.Core/Tensors/Tensor.Assign.cs index eaaae613..4312a291 100644 --- a/src/TensorFlowNET.Core/Tensors/Tensor.Assign.cs +++ b/src/TensorFlowNET.Core/Tensors/Tensor.Assign.cs @@ -18,7 +18,9 @@ namespace Tensorflow return OriginalVar; } else - throw new RuntimeError("Operation doesn't support."); + { + throw new RuntimeError($"Operation doesn't support. {this.name} is a constant tensor. Make sure to initiate {this.name} from tf.Variable() and declare {this.name} as ResourceVariable or var."); + } } } }