When customing op, defining module or functional?

Hello. I am customing a operator. It occurs to me that how one make a decision to define a module or functional?

usually if it has learnable weights make it a Module, if not make it functional.