Normalize#
- class torchaug.transforms.Normalize(mean, std, cast_dtype=None, inplace=False, value_check=False)[source]#
Normalize a tensor image with mean and standard deviation. Given mean:
(mean[1],...,mean[n])and std:(std[1],..,std[n])fornchannels, this transform will normalize each channel of the inputtorch.Tensori.e.,output[channel] = (input[channel] - mean[channel]) / std[channel]- Parameters:
mean (
Union[Sequence[float],float]) – Sequence of means for each channel.std (
Union[Sequence[float],float]) – Sequence of standard deviations for each channel.cast_dtype (
Optional[dtype], optional) – If not None, scale and cast input to dtype. Expected to be a float dtype.Default:Noneinplace (
bool, optional) – Bool to make this operation in-place.Default:Falsevalue_check (
bool, optional) – Bool to perform tensor value check. Might cause slow down on some devices because of synchronization.