import torch


def normalize_torch(img: torch.Tensor) -> torch.Tensor:
    """
    Standardize image tensor per channel

    Args:
    -----------
        img (torch.Tensor):
            input image tensor. shape (C, H, W).

    Returns:
    -----------
        torch.Tensor. Standardized image tensor. Shape (C, H, W).
    """
    img = img.float()
    chl_means = torch.mean(img.float(), dim=(1, 2))
    chl_stds = torch.std(img.float(), dim=(1, 2))

    img.sub_(chl_means.view(-1, 1, 1)).div_(chl_stds.view(-1, 1, 1))
    
    return img