code: def _compute_rotation_matrix3d(
      yaw: torch.Tensor,
      pitch: torch.Tensor,
      roll: torch.Tensor,
      center: torch.Tensor,
  ) -> torch.Tensor:
      """Compute a pure affine rotation matrix."""
      if len(yaw.shape) == len(pitch.shape) == len(roll.shape) == 0:
          yaw = yaw.unsqueeze(dim=0)
          pitch = pitch.unsqueeze(dim=0)
          roll = roll.unsqueeze(dim=0)
  
      if len(yaw.shape) == len(pitch.shape) == len(roll.shape) == 1:
          yaw = yaw.unsqueeze(dim=1)
          pitch = pitch.unsqueeze(dim=1)
          roll = roll.unsqueeze(dim=1)
  
      if not (
          len(yaw.shape) == len(pitch.shape) == len(roll.shape) == 2
      ):
          raise AssertionError(
              f"Expected yaw, pitch, roll to be (B, 1). Got {yaw.shape}, {pitch.shape}, {roll.shape}."
          )
  
      angles: torch.Tensor = torch.cat([yaw, pitch, roll], dim=1)
      scales: torch.Tensor = ones_like(yaw)
      matrix: torch.Tensor = get_projective_transform(
          center, angles, scales
      )
      return matrix
  
imports: from typing import Optional, Tuple, Union
  import torch
  from torch import nn
  from kornia.core import ones, ones_like, zeros
  from kornia.filters import gaussian_blur2d
  from kornia.utils import _extract_device_dtype
  from kornia.utils.image import perform_keep_shape_image
  from kornia.utils.misc import eye_like
  from .imgwarp import get_affine_matrix2d, get_projective_transform, get_rotation_matrix2d, warp_affine, warp_affine3d
label_desc: Use image node_id 4 for calling a global function with example usage: _compute_rotation_matrix3d(yaw, pitch, roll, center) and returns: matrix