nn.CrossEntropyLoss: - optimizer not updating weights

Check this one. Your can check input.requires_grad and if not True this is the problem.

Note: input.requires_grad=True all Tensors computed from input will have requires_grad attribute True. It is like covid-19.

This way you can fool a pretrained network to change its prediction by modifying the input features.