code: def test_rotate_shape_mismatch():
      np_rng = np.random.default_rng(42)
      batch_size = 8
      num_frames = 50
  
      def mt():
          return np.float32(
              np_rng.uniform(-100, 250, (num_frames, 2, 3))
          )
  
      mts_inp = [mt() for _ in range(batch_size)]
      angles_inp = [
          np.array(
              [angle for angle in range(num_frames - i)],
              dtype=np.float32,
          )
          for i in range(batch_size)
      ]
      centers_inp = [
          np.array([c for c in range(num_frames + i)], dtype=np.float32)
          for i in range(batch_size)
      ]
  
      with assert_raises(
          RuntimeError,
          glob="The sample 1 of tensor argument `angle` "
          "contains 49 per-frame parameters, but there are 50 frames in "
          "the corresponding sample of input 0.",
      ):
  
          @pipeline_def
          def pipeline():
              mts, angles = fn.external_source(
                  lambda _: (mts_inp, angles_inp), num_outputs=2
              )
              return fn.transforms.rotation(
                  fn.per_frame(mts), angle=fn.per_frame(angles)
              )
  
          pipe = pipeline(
              batch_size=batch_size, num_threads=4, device_id=0
          )
          pipe.build()
          pipe.run()
  
      with assert_raises(
          RuntimeError,
          glob="The sample 1 of tensor argument `center` contains 51 "
          "per-frame parameters, but there are 49 frames in the corresponding sample "
          "of argument `angle`",
      ):
  
          @pipeline_def
          def pipeline():
              angles, centers = fn.external_source(
                  lambda _: (angles_inp, centers_inp), num_outputs=2
              )
              return fn.transforms.rotation(
                  angle=fn.per_frame(angles),
                  center=fn.per_frame(centers),
              )
  
          pipe = pipeline(
              batch_size=batch_size, num_threads=4, device_id=0
          )
          pipe.build()
          pipe.run()
  
imports: import random
  import warnings
  import numpy
  from scipy.spatial.transform import Rotation
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops.transforms
  import nvidia.dali.ops
  import nvidia.dali.fn
  from nvidia.dali import pipeline_def
  from sequences_test_utils import ArgData, ArgDesc, sequence_suite_helper, ArgCb, ParamsProvider
  from nose_utils import assert_raises
label_desc: Use image node_id 29 for calling a global function with example usage: test_rotate_shape_mismatch() and returns: np, fn, fn