Normalize vectors to [-1,1] or [0,1]

I don’t think there currently is an in-build PyTorch function for what you want.
If you really want a specific function for it, instead of simply doing this yourself, “torchsample”: https://github.com/ncullen93/torchsample offers a “RangeNormalize” function where you can just specify min and max range values (tuples per channel: i.e. ((0,0,0),(1,1,1)) or just floats (0, 1)

1 Like