Both the documentation and the source code show that torch vision.transforms.functional.normalize has an inplace parameter allowing for the passed tensor to not be duplicated.
https://pytorch.org/docs/stable/torchvision/transforms.html#torchvision.transforms.functional.normalize 12
However, testing this out, I receive the following errors:
TypeError: normalize() takes 3 positional arguments but 4 were given

and
TypeError: normalize() got an unexpected keyword argument 'inplace'

Here’s the example code which does not work:
import torchvision.transforms.functional as tf
from PIL import Image

# Load image
img = tf.to_tensor(tf.resize(Image.open(argv[1]), (img_size, img_size)))
# Normalize image
tf.normalize(img, [c.mean() for c in img], [c.std() for c in img], inplace=True)

The source code is easy enough to duplicate, but I’m just wondering if I’m doing something wrong, or this is an issue with the documentation!
Edit:  It appears that even with inplace as false, normalize performs the operation in place! This is at odds with what the documentation states. I’m hesitant to use this function and rely on it continuing to be in place, as the documentation states otherwise.