I have started using TensorFlow 2.0 and have a little uncertainty with regard to one aspect.
Suppose I have this use case: while ingesting data with the tf.dat
There is no other way of doing it, because tf.data.Dataset
s are still (and they will always be, I suppose, for performance reasons) executed in graph mode and, thus, you cannot use anything outside of the tf.*
methods, that can be easily converted by TensorFlow to its graph representation.
Using tf.py_function
is the only way to mix Python execution (and thus, you can use any Python library) and graph execution when using a tf.data.Dataset
object (on the contrary of what happens when using TensorFlow 2.0, that being eager by default allow this mixed execution naturally).