def rad2deg(tensor: torch.Tensor) -> torch.Tensor:
    'Function that converts angles from radians to degrees.\n\n    Args:\n        tensor (torch.Tensor): Tensor of arbitrary shape.\n\n    Returns:\n        torch.Tensor: Tensor with same shape as input.\n\n    Example:\n        >>> input = torch.tensor(3.1415926535) * torch.rand(1, 3, 3)\n        >>> output = rad2deg(input)\n    '
    if (not isinstance(tensor, torch.Tensor)):
        raise TypeError('Input type is not a torch.Tensor. Got {}'.format(type(tensor)))
    return ((180.0 * tensor) / pi.to(tensor.device).type(tensor.dtype))
Function that converts angles from radians to degrees.

Args:
    tensor (torch.Tensor): Tensor of arbitrary shape.

Returns:
    torch.Tensor: Tensor with same shape as input.

Example:
    >>> input = torch.tensor(3.1415926535) * torch.rand(1, 3, 3)
    >>> output = rad2deg(input)
def rad2deg(tensor: torch.Tensor) -> torch.Tensor:
    'Function that converts angles from radians to degrees.\n\n    Args:\n        tensor (torch.Tensor): Tensor of arbitrary shape.\n\n    Returns:\n        torch.Tensor: Tensor with same shape as input.\n\n    Example:\n        >>> input = torch.tensor(3.1415926535) * torch.rand(1, 3, 3)\n        >>> output = rad2deg(input)\n    '
    if (not isinstance(tensor, torch.Tensor)):
        raise TypeError('Input type is not a torch.Tensor. Got {}'.format(type(tensor)))
    return ((180.0 * tensor) / pi.to(tensor.device).type(tensor.dtype))