3 ms·
You wrote this... All the comparisons like > are better written using their TensorFlow equivalent (e.g tf.greater). Autograph can convert them (you could wri
by brilee 5y ago
You wrote this...
All the comparisons like > are better written using their TensorFlow equivalent (e.g tf.greater). Autograph can convert them (you could write >), but it’s less idiomatic and I recommend to do not relying upon the automatic conversion, for having full control.
...but I'm not sure you realized that the for loop and the if statement in your code are being transparently compiled to dataset.map() and tf.cond() for you by Autograph :)
- me2too 5y agoYup! I realized it. I wrote that because in the past there was a huge problem with the operators, as I explained in this talk: https://pgaleone.eu/tf-function-talk/#slide=28 https://pgaleone.eu/tf-function-talk/#slide=28 Even if now autograph is able to convert them correctly, I still prefer to have every operator explicitly converted whenever possibile. The loop, luckily, never had this transpilation problems