code: def pol2cart(rho: Tensor, phi: Tensor) -> tuple[Tensor, Tensor]:
      r"""Function that converts polar coordinates to cartesian coordinates.
  
      Args:
          rho: Tensor of arbitrary shape.
          phi: Tensor of same arbitrary shape.
  
      Returns:
          - x: Tensor with same shape as input.
          - y: Tensor with same shape as input.
  
      Example:
          >>> rho = torch.rand(1, 3, 3)
          >>> phi = torch.rand(1, 3, 3)
          >>> x, y = pol2cart(rho, phi)
      """
      if not (isinstance(rho, Tensor) & isinstance(phi, Tensor)):
          raise TypeError(
              f"Input type is not a Tensor. Got {type(rho)}, {type(phi)}"
          )
  
      x = rho * cos(phi)
      y = rho * sin(phi)
      return x, y
  
imports: from __future__ import annotations
  from typing import Optional
  import torch
  import torch.nn.functional
  from kornia.constants import pi
  from kornia.core import Tensor, concatenate, cos, pad, sin, stack, tensor, where, zeros_like
  from kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_SHAPE
  from kornia.utils import deprecated
  from kornia.utils.helpers import _torch_inverse_cast
label_desc: Use image node_id 3 for calling a global function with example usage: pol2cart(rho, phi) and returns: x,  y