How to do so when loading a PIL image?
In my case I am loading a PIL image and then using pre-configured transform object:
img = Image.open(pretrained_img_path)

        noise = transform(img).unsqueeze(0)

        noise.requires_grad = True

        print(noise.requires_grad)

        noise = noise.to(device)