class_docstr: AugmentationBase2D base class for rigid/affine augmentation implementations.
  
  RigidAffineAugmentationBase2D enables routined transformation with given transformation matrices
  for different data types like masks, boxes, and keypoints.
  
  Args:
      p: probability for applying an augmentation. This param controls the augmentation probabilities
        element-wise for a batch.
      p_batch: probability for applying an augmentation to a batch. This param controls the augmentation
        probabilities batch-wise.
      same_on_batch: apply the same transformation across the batch.
      keepdim: whether to keep the output shape the same as input ``True`` or broadcast it to the batch
        form ``False``.
docstr: Generate transformation matrices with the given input and param settings.
docstr_tok: ["Generate","transformation","matrices","with","the","given","input","and","param","settings","."]
code: def generate_transformation_matrix(
      self,
      input: Tensor,
      params: Dict[str, Tensor],
      flags: Dict[str, Any],
  ) -> Tensor:
      """Generate transformation matrices with the given input and param settings."""
      batch_prob = params["batch_prob"]
      to_apply = (
          batch_prob > 0.5
      )  # NOTE: in case of Relaxed Distributions.
      in_tensor = self.transform_tensor(input)
      if not to_apply.any():
          trans_matrix = self.identity_matrix(in_tensor)
      elif to_apply.all():
          trans_matrix = self.compute_transformation(
              in_tensor, params=params, flags=flags
          )
      else:
          trans_matrix = self.identity_matrix(in_tensor)
          trans_matrix = trans_matrix.index_put(
              (to_apply,),
              self.compute_transformation(
                  in_tensor[to_apply], params=params, flags=flags
              ),
          )
      return trans_matrix
  
imports: from typing import Any, Dict, Optional
  from torch import float16, float32, float64
  import kornia
  from kornia.augmentation.base import _AugmentationBase
  from kornia.augmentation.utils import _transform_input3d, _validate_input_dtype
  from kornia.core import Tensor
  from kornia.geometry.boxes import Boxes3D
  from kornia.geometry.keypoints import Keypoints3D
label_desc: Use image node_id 3 for calling the RigidAffineAugmentationBase3D obj's underlying member method code with example usage: obj.generate_transformation_matrix(input, params, flags) and returns: trans_matrix