code: def rad2deg(tensor: Tensor) -> Tensor:
      r"""Function that converts angles from radians to degrees.
  
      Args:
          tensor: Tensor of arbitrary shape.
  
      Returns:
          Tensor with same shape as input.
  
      Example:
          >>> input = tensor(3.1415926535)
          >>> rad2deg(input)
          tensor(180.)
      """
      if not isinstance(tensor, Tensor):
          raise TypeError(
              f"Input type is not a Tensor. Got {type(tensor)}"
          )
  
      return 180.0 * tensor / pi.to(tensor.device).type(tensor.dtype)
  
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 1 for calling a global function with example usage: rad2deg(tensor) and returns: unknown