class_docstr: 3D boxes containing N or BxN boxes.
  
  Args:
      boxes: 3D boxes, shape of :math:`(N,8,3)` or :math:`(B,N,8,3)`. See below for more details.
      raise_if_not_floating_point: flag to control floating point casting behaviour when `boxes` is not a floating
          point tensor. True to raise an error when `boxes` isn't a floating point tensor, False to cast to float.
  
  Note:
      **3D boxes format** is defined as a floating data type tensor of shape ``Nx8x3`` or ``BxNx8x3`` where each box
      is a `hexahedron <https://en.wikipedia.org/wiki/Hexahedron>`_ defined by it's 8 vertices coordinates.
      Coordinates must be in ``x, y, z`` order. The height, width and depth of a box is defined as
      ``width = xmax - xmin + 1``, ``height = ymax - ymin + 1`` and ``depth = zmax - zmin + 1``. Examples of
      `hexahedrons <https://en.wikipedia.org/wiki/Hexahedron>`_ are cubes and rhombohedrons.
class_docstr_tok: ["3D","boxes","containing","N","or","BxN","boxes",".","Args",":","boxes",":","3D","boxes",",","shape","of",":","math",":","`","(","N,8,3",")","`","or",":","math",":","`","(","B",",","N,8,3",")","`",".","See","below","for","more","details",".","raise_if_not_floating_point",":","flag","to","control","floating","point","casting","behaviour","when","`","boxes","`","is","not","a","floating","point","tensor",".","True","to","raise","an","error","when","`","boxes","`","is","n't","a","floating","point","tensor",",","False","to","cast","to","float",".","Note",":","*","*","3D","boxes","format","*","*","is","defined","as","a","floating","data","type","tensor","of","shape","``","Nx8x3","``","or","``","BxNx8x3","``","where","each","box","is","a","`","hexahedron","<","https",":","\/\/en.wikipedia.org\/wiki\/Hexahedron",">","`","_","defined","by","it","'s","8","vertices","coordinates",".","Coordinates","must","be","in","``","x",",","y",",","z","``","order",".","The","height",",","width","and","depth","of","a","box","is","defined","as","``","width","=","xmax","-","xmin","+","1","``",",","``","height","=","ymax","-","ymin","+","1","``","and","``","depth","=","zmax","-","zmin","+","1","``",".","Examples","of","`","hexahedrons","<","https",":","\/\/en.wikipedia.org\/wiki\/Hexahedron",">","`","_","are","cubes","and","rhombohedrons","."]
docstr: Apply a transformation matrix to the 3D boxes.
  
  Args:
      M: The transformation matrix to be applied, shape of :math:`(4, 4)` or :math:`(B, 4, 4)`.
      inplace: do transform in-place and return self.
  
  Returns:
      The transformed boxes.
code: def transform_boxes(
      self, M: torch.Tensor, inplace: bool = False
  ) -> Boxes3D:
      r"""Apply a transformation matrix to the 3D boxes.
  
      Args:
          M: The transformation matrix to be applied, shape of :math:`(4, 4)` or :math:`(B, 4, 4)`.
          inplace: do transform in-place and return self.
  
      Returns:
          The transformed boxes.
      """
      if not 2 <= M.ndim <= 3 or M.shape[-2:] != (4, 4):
          raise ValueError(
              f"The transformation matrix shape must be (4, 4) or (B, 4, 4). Got {M.shape}."
          )
  
      transformed_boxes = _transform_boxes(self._data, M)
      if inplace:
          self._data = transformed_boxes
          return self
  
      return Boxes3D(transformed_boxes, False, "xyzxyz_plus")
  
imports: from __future__ import annotations
  from typing import Optional, cast
  import torch
  from torch import Size
  from kornia.core import Tensor, stack, zeros
  from kornia.geometry.bbox import validate_bbox
  from kornia.geometry.linalg import transform_points
  from kornia.utils import eye_like
label_desc: Use image node_id 9 for calling the Boxes3D obj's underlying member method code with example usage: obj.transform_boxes(M, inplace) and returns: Boxes3D, self