Here you have rotation + translation

  

      github.com
  

  
    tensorflow/addons/blob/master/tensorflow_addons/image/tests/transform_ops_test.py#L41-L55 11



      
      
          def test_compose(dtype):
              image = tf.constant(
                  [[1, 1, 1, 0], [1, 0, 0, 0], [1, 1, 1, 0], [0, 0, 0, 0]], dtype=dtype
              )
              # Rotate counter-clockwise by pi / 2.
              rotation = transform_ops.angles_to_projective_transforms(np.pi / 2, 4, 4)
              # Translate right by 1 (the transformation matrix is always inverted,
              # hence the -1).
              translation = tf.constant([1, 0, -1, 0, 1, 0, 0, 0], dtype=tf.dtypes.float32)
              composed = transform_ops.compose_transforms([rotation, translation])
              image_transformed = transform_ops.transform(image, composed)
              np.testing.assert_equal(
                  [[0, 0, 0, 0], [0, 1, 0, 1], [0, 1, 0, 1], [0, 1, 1, 1]],
                  image_transformed.numpy(),
              )