normalize¶
-
torchvision.transforms.functional.
normalize
(tensor: torch.Tensor, mean: List[float], std: List[float], inplace: bool = False) → torch.Tensor[source]¶ Normalize a float tensor image with mean and standard deviation. This transform does not support PIL Image.
Note
This transform acts out of place by default, i.e., it does not mutates the input tensor.
See
Normalize
for more details.- Parameters
tensor (Tensor) – Float tensor image of size (C, H, W) or (B, C, H, W) to be normalized.
mean (sequence) – Sequence of means for each channel.
std (sequence) – Sequence of standard deviations for each channel.
inplace (bool,optional) – Bool to make this operation inplace.
- Returns
Normalized Tensor image.
- Return type
Tensor