Your code wouldn’t freeze the last layer but replace it with an Identity layer, so that the output activations of the penultimate layer will be returned.
If you don’t use an activation function such as nn.ReLU the activations could certainly be negative, so I’m unsure why negative values would be a concern.