def cart2pol(x: torch.Tensor, y: torch.Tensor, eps: float=1e-08) -> Tuple[(torch.Tensor, torch.Tensor)]:
    'Function that converts cartesian coordinates to polar coordinates.\n\n    Args:\n        rho (torch.Tensor): Tensor of arbitrary shape.\n        phi (torch.Tensor): Tensor of same arbitrary shape.\n        eps (float): To avoid division by zero. Default is 1e-8\n\n    Returns:\n        torch.Tensor, torch.Tensor: Tensor with same shape as input.\n\n    Example:\n        >>> x = torch.rand(1, 3, 3)\n        >>> y = torch.rand(1, 3, 3)\n        >>> rho, phi = cart2pol(x, y)\n    '
    if (not (isinstance(x, torch.Tensor) & isinstance(y, torch.Tensor))):
        raise TypeError('Input type is not a torch.Tensor. Got {}, {}'.format(type(x), type(y)))
    rho = torch.sqrt((((x ** 2) + (y ** 2)) + eps))
    phi = torch.atan2(y, x)
    return (rho, phi)
Function that converts cartesian coordinates to polar coordinates.

Args:
    rho (torch.Tensor): Tensor of arbitrary shape.
    phi (torch.Tensor): Tensor of same arbitrary shape.
    eps (float): To avoid division by zero. Default is 1e-8

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

Example:
    >>> x = torch.rand(1, 3, 3)
    >>> y = torch.rand(1, 3, 3)
    >>> rho, phi = cart2pol(x, y)
def cart2pol(x: torch.Tensor, y: torch.Tensor, eps: float=1e-08) -> Tuple[(torch.Tensor, torch.Tensor)]:
    'Function that converts cartesian coordinates to polar coordinates.\n\n    Args:\n        rho (torch.Tensor): Tensor of arbitrary shape.\n        phi (torch.Tensor): Tensor of same arbitrary shape.\n        eps (float): To avoid division by zero. Default is 1e-8\n\n    Returns:\n        torch.Tensor, torch.Tensor: Tensor with same shape as input.\n\n    Example:\n        >>> x = torch.rand(1, 3, 3)\n        >>> y = torch.rand(1, 3, 3)\n        >>> rho, phi = cart2pol(x, y)\n    '
    if (not (isinstance(x, torch.Tensor) & isinstance(y, torch.Tensor))):
        raise TypeError('Input type is not a torch.Tensor. Got {}, {}'.format(type(x), type(y)))
    rho = torch.sqrt((((x ** 2) + (y ** 2)) + eps))
    phi = torch.atan2(y, x)
    return (rho, phi)