def denormalize_pixel_coordinates3d(pixel_coordinates: torch.Tensor, depth: int, height: int, width: int, eps: float=1e-08) -> torch.Tensor:
    'Denormalize pixel coordinates.\n\n    The input is assumed to be -1 if on extreme left, 1 if on\n    extreme right (x = w-1).\n\n    Args:\n        pixel_coordinates (torch.Tensor): the normalized grid coordinates.\n          Shape can be :math:`(*, 3)`.\n        depth (int): the maximum depth in the x-axis.\n        height (int): the maximum height in the y-axis.\n        width (int): the maximum width in the x-axis.\n        eps (float): safe division by zero. (default 1e-8).\n\n\n    Return:\n        torch.Tensor: the denormalized pixel coordinates.\n    '
    if (pixel_coordinates.shape[(- 1)] != 3):
        raise ValueError('Input pixel_coordinates must be of shape (*, 3). Got {}'.format(pixel_coordinates.shape))
    dhw: torch.Tensor = torch.stack([torch.tensor(depth), torch.tensor(width), torch.tensor(height)]).to(pixel_coordinates.device).to(pixel_coordinates.dtype)
    factor: torch.Tensor = (torch.tensor(2.0) / (dhw - 1).clamp(eps))
    return ((torch.tensor(1.0) / factor) * (pixel_coordinates + 1))
Denormalize pixel coordinates.

The input is assumed to be -1 if on extreme left, 1 if on
extreme right (x = w-1).

Args:
    pixel_coordinates (torch.Tensor): the normalized grid coordinates.
      Shape can be :math:`(*, 3)`.
    depth (int): the maximum depth in the x-axis.
    height (int): the maximum height in the y-axis.
    width (int): the maximum width in the x-axis.
    eps (float): safe division by zero. (default 1e-8).


Return:
    torch.Tensor: the denormalized pixel coordinates.
def denormalize_pixel_coordinates3d(pixel_coordinates: torch.Tensor, depth: int, height: int, width: int, eps: float=1e-08) -> torch.Tensor:
    'Denormalize pixel coordinates.\n\n    The input is assumed to be -1 if on extreme left, 1 if on\n    extreme right (x = w-1).\n\n    Args:\n        pixel_coordinates (torch.Tensor): the normalized grid coordinates.\n          Shape can be :math:`(*, 3)`.\n        depth (int): the maximum depth in the x-axis.\n        height (int): the maximum height in the y-axis.\n        width (int): the maximum width in the x-axis.\n        eps (float): safe division by zero. (default 1e-8).\n\n\n    Return:\n        torch.Tensor: the denormalized pixel coordinates.\n    '
    if (pixel_coordinates.shape[(- 1)] != 3):
        raise ValueError('Input pixel_coordinates must be of shape (*, 3). Got {}'.format(pixel_coordinates.shape))
    dhw: torch.Tensor = torch.stack([torch.tensor(depth), torch.tensor(width), torch.tensor(height)]).to(pixel_coordinates.device).to(pixel_coordinates.dtype)
    factor: torch.Tensor = (torch.tensor(2.0) / (dhw - 1).clamp(eps))
    return ((torch.tensor(1.0) / factor) * (pixel_coordinates + 1))