code: def get_dynamic_size(
      feature: tf.Tensor, dtype=tf.int32, has_channel_dim: bool = True
  ) -> SizeTuple:
      """Returns dynamic size (height, width) of image, video, or mask."""
      if feature.dtype.name == "string":  # Encoded jpeg.
          shape = tf.io.extract_jpeg_shape(feature)
      else:
          shape = tf.shape(feature)
          if has_channel_dim:
              assert (
                  shape.shape[0] >= 3
              ), "Expected: [..., height, width, channels]"
              shape = shape[-3:-1]
          else:
              assert (
                  shape.shape[0] >= 2
              ), "Expected: [..., height, width]"
              shape = shape[-2:]
      h = tf.cast(shape[0], dtype=dtype)
      w = tf.cast(shape[1], dtype=dtype)
      return h, w
  
file_path: scenic/scenic/projects/owl_vit/preprocessing/transforms.py
imports: from typing import Any, Optional, Sequence, Tuple, Union
  import tensorflow
label_desc: Use image node_id 6 for calling a global function with example usage: get_dynamic_size(feature, dtype, has_channel_dim) and returns: h,  w