Skip to content

Commit 5f217f1

Browse files
BanycOceania2018
authored andcommitted
Better error message for Tensor.assign
1 parent 08e174e commit 5f217f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/TensorFlowNET.Core/Tensors/Tensor.Assign.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ public ResourceVariable assign(Tensor tensor)
1818
return OriginalVar;
1919
}
2020
else
21-
throw new RuntimeError("Operation doesn't support.");
21+
{
22+
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.");
23+
}
2224
}
2325
}
2426
}

0 commit comments

Comments
 (0)