An Optional can represent the result of an operation that may fail as a
value, rather than raising an exception and halting execution. For example,
tf.data.experimental.get_next_as_optional returns an Optional that either
contains the next value of an iterator if one exists, or a "none" value that
indicates the end of the sequence has been reached.
Optional can only be used by values that are convertible to Tensor or
CompositeTensor.
If this optional does not have a value (i.e. self.has_value() evaluates
to False), this operation will raise tf.errors.InvalidArgumentError
at runtime.