def uv_grid(shape): u, v = tf.meshgrid(tf.linspace(0.0, 1.0, shape[1]), tf.linspace(0.0, 1.0, shape[0])) return u, v