Option I found that the job is to use the package, but if there is a better way, write the answer:
def rotate(tf, points, theta): top = tf.pack([tf.cos(theta), -tf.sin(theta)]) bottom = tf.pack([tf.sin(theta), tf.cos(theta)]) rotation_matrix = tf.pack([top, bottom]) return tf.matmul(points, rotation_matrix)
source share