[tf.data] Make error message more informative.

PiperOrigin-RevId: 361352108
Change-Id: Ib4ffb578da274df1accb615f7fe1c04bd58b321d
This commit is contained in:
Jiri Simsa 2021-03-06 14:44:35 -08:00 committed by TensorFlower Gardener
parent 051a96f3ec
commit 99b1fa6a15

View File

@ -56,7 +56,9 @@ class OptionsBase(object):
def __setattr__(self, name, value):
if not self._mutable:
raise ValueError("Mutating `tf.data.Options()` returned by "
"`tf.data.Dataset.options()` has no effect.")
"`tf.data.Dataset.options()` has no effect. Use "
"`tf.data.Dataset.with_options(options)` to set or "
"update dataset options.")
if hasattr(self, name):
object.__setattr__(self, name, value)
else: