How scale data to 0 to 1 range after each layer

I am building an image restoration CNN. After each layer, I need the data to be scaled between 0 to 1. Is there any built-in normalization/scaling technique? Also, it would be sufficient if I can adjust the nn.batchnorm2d() to scale the data to 0 to 1 range. I am just a beginner to pyTorch.

There are many ways to do this, but a simple method is to just do something like a = a/torch.max(a), perhaps adding some epsilon to the divisor for numerical stability.

Thank you for the reply. I will try to use this solution.