Browse Source

Better error message for Tensor.assign

tags/keras_v0.3.0
Banyc Haiping 4 years ago
parent
commit
5f217f1b18
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/TensorFlowNET.Core/Tensors/Tensor.Assign.cs

+ 3
- 1
src/TensorFlowNET.Core/Tensors/Tensor.Assign.cs View File

@@ -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.");
}
}
}
}

Loading…
Cancel
Save