code: def _build_perspective_param3d(
      p: Tensor, q: Tensor, axis: str
  ) -> Tensor:
      ones = torch.ones_like(p)[..., 0:1]
      zeros = torch.zeros_like(p)[..., 0:1]
  
      if axis == "x":
          return concatenate(
              [
                  p[:, 0:1],
                  p[:, 1:2],
                  p[:, 2:3],
                  ones,
                  zeros,
                  zeros,
                  zeros,
                  zeros,
                  zeros,
                  zeros,
                  zeros,
                  zeros,
                  -p[:, 0:1] * q[:, 0:1],
                  -p[:, 1:2] * q[:, 0:1],
                  -p[:, 2:3] * q[:, 0:1],
              ],
              1,
          )
  
      if axis == "y":
          return concatenate(
              [
                  zeros,
                  zeros,
                  zeros,
                  zeros,
                  p[:, 0:1],
                  p[:, 1:2],
                  p[:, 2:3],
                  ones,
                  zeros,
                  zeros,
                  zeros,
                  zeros,
                  -p[:, 0:1] * q[:, 1:2],
                  -p[:, 1:2] * q[:, 1:2],
                  -p[:, 2:3] * q[:, 1:2],
              ],
              1,
          )
  
      if axis == "z":
          return concatenate(
              [
                  zeros,
                  zeros,
                  zeros,
                  zeros,
                  zeros,
                  zeros,
                  zeros,
                  zeros,
                  p[:, 0:1],
                  p[:, 1:2],
                  p[:, 2:3],
                  ones,
                  -p[:, 0:1] * q[:, 2:3],
                  -p[:, 1:2] * q[:, 2:3],
                  -p[:, 2:3] * q[:, 2:3],
              ],
              1,
          )
  
      raise NotImplementedError(
          f"perspective params for axis `{axis}` is not implemented."
      )
  
imports: from __future__ import annotations
  from typing import Optional
  import torch
  import torch.nn.functional
  from kornia.core import Tensor, concatenate, ones, ones_like, stack, tan, tensor, zeros
  from kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_SHAPE
  from kornia.geometry.conversions import angle_to_rotation_matrix, axis_angle_to_rotation_matrix, convert_affinematrix_to_homography, convert_affinematrix_to_homography3d, deg2rad, normalize_homography, normalize_homography3d, normalize_pixel_coordinates
  from kornia.geometry.linalg import transform_points
  from kornia.utils import create_meshgrid, create_meshgrid3d, eye_like
  from kornia.utils.helpers import _torch_inverse_cast, _torch_solve_cast
label_desc: Use image node_id 20 for calling a global function with example usage: _build_perspective_param3d(p, q, axis) and returns: concatenate, concatenate, concatenate