def adjust_hue_raw(image: Tensor, factor: Union[float, Tensor]) -> Tensor:
    r"""Adjust hue of an image.

    Expecting image to be in hsv format already.
    """
    KORNIA_CHECK_IS_TENSOR(image, "Expected shape (*, H, W)")
    KORNIA_CHECK(
        isinstance(factor, (float, Tensor)),
        f"The factor should be a float number or Tensor in the range between [-PI, PI]. Got {type(factor)}",
    )

    if isinstance(factor, float):
        factor = torch.as_tensor(factor)

    factor = factor.to(image.device, image.dtype)

    # make factor broadcastable
    while len(factor.shape) != len(image.shape):
        factor = factor[..., None]

    # unpack the hsv values
    h, s, v = torch.chunk(image, chunks=3, dim=-3)

    # transform the hue value and appl module
    divisor: float = 2 * pi
    h_out: Tensor = torch.fmod(h + factor, divisor)

    # pack back back the corrected hue
    out: Tensor = torch.cat([h_out, s, v], dim=-3)

    return out
Adjust hue of an image.

    Expecting image to be in hsv format already.
    
kornia/enhance/adjust.py