Using `tf.function` for performance in Tensorflow 2

By Dmitry Kabanov