code: def transform_pointcloud(
      pointclouds,
      sizes_3d,
      rotations_3d,
      translations_3d,
      inverse=False,
  ):
      """Transform pointcloud."""
      batch_size = rotations_3d.shape[0]
      rotations_3d = tf.reshape(rotations_3d, [batch_size, -1, 3, 3])
      if inverse:
          sizes_3d = tf.linalg.diag(1.0 / sizes_3d)
          rotations_3d = tf.transpose(rotations_3d, [0, 1, 3, 2])
          pointclouds -= tf.expand_dims(translations_3d, 2)
          pointclouds = tf.transpose(pointclouds, [0, 1, 3, 2])
          pointclouds = sizes_3d @ rotations_3d @ pointclouds
          pointclouds = tf.transpose(pointclouds, [0, 1, 3, 2])
      else:
          sizes_3d = tf.linalg.diag(sizes_3d)
          pointclouds = tf.transpose(pointclouds, [0, 1, 3, 2])
          pointclouds = rotations_3d @ sizes_3d @ pointclouds
          pointclouds = tf.transpose(pointclouds, [0, 1, 3, 2])
          pointclouds += tf.expand_dims(translations_3d, 2)
      return pointclouds
  
file_path: graphics/tensorflow_graphics/projects/points_to_3Dobjects/models/centernet_utils.py
imports: import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: transform_pointcloud(pointclouds, sizes_3d, rotations_3d, translations_3d, inverse) and returns: pointclouds