|View source on GitHub|
Represents a value that may or may not be present.
See Migration guide for more details.
tf.experimental.Optional can represent the result of an operation that may
fail as a value, rather than raising an exception and halting execution. For
tf.data.Iterator.get_next_as_optional() returns a
tf.experimental.Optional that either contains the next element of an
iterator if one exists, or an "empty" value that indicates the end of the
sequence has been reached.
tf.experimental.Optional can only be used with values that are convertible