How to normalize data without creating a transform.compose block

This is what I have-

    images = Variable(torch.from_numpy(X)).to(device) # [batch, channel, H, W]
    masks = Variable(torch.from_numpy(y)).to(device) 
    # print("images",type(images)) # output: tensor class
                    
    images = Normalize(images,(0, 0, 0, 0, 0), (0, 0, 0,0, 0))
    masks =  Normalize(masks, (0.0), (0.0))
    
    optim.zero_grad()        
    outputs = model(images)
    loss = criterion(outputs, masks)
    loss.backward() 

I get the error TypeError: conv2d(): argument 'input' (position 1) must be Tensor, not Normalize
To the best of my understanding, model needs a tensor. How should I give it that?

torchvision.transforms.Normalize is a class so you would need to create an instance and apply it with your tensor afterwards:

norm = Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))
x = norm(x)