code: def combine_transforms(
      left: torch.Tensor, right: torch.Tensor
  ) -> torch.Tensor:
      """Given transforms A and B to be applied to x, return the combined transform (AB), so that A(B(x)) becomes AB(x)"""
      if Affine.is_affine_shaped(left) and Affine.is_affine_shaped(
          right
      ):  # linear transforms
          left = convert_to_tensor(
              left.data if isinstance(left, Affine) else left,
              wrap_sequence=True,
          )
          right = convert_to_tensor(
              right.data if isinstance(right, Affine) else right,
              wrap_sequence=True,
          )
          return torch.matmul(left, right)
      if DisplacementField.is_ddf_shaped(
          left
      ) and DisplacementField.is_ddf_shaped(
          right
      ):  # adds DDFs, do we need metadata if metatensor input?
          left = convert_to_tensor(
              left.data
              if isinstance(left, DisplacementField)
              else left,
              wrap_sequence=True,
          )
          right = convert_to_tensor(
              right.data
              if isinstance(right, DisplacementField)
              else right,
              wrap_sequence=True,
          )
          return left + right
      raise NotImplementedError
  
imports: from __future__ import annotations
  import warnings
  import numpy
  import torch
  import monai
  from monai.config import NdarrayOrTensor
  from monai.data.utils import AFFINE_TOL
  from monai.transforms.utils_pytorch_numpy_unification import allclose
  from monai.utils import LazyAttr, convert_to_numpy, convert_to_tensor, look_up_option
label_desc: Use image node_id 1 for calling a global function with example usage: combine_transforms(left, right) and returns: torch, unknown