Hi,
The common way to do that is to use THGenerateFloatTypes.h.
You can take a look at this 31 repo. Even though it was done for lua torch, it shows how to use this to generate different functions automatically for different types. You will need to add them properly into a python module instead of lua module.