so, is there a simple attribute / method or function that one could use to return a bool whether a module contains code that changes depending on the .train()-state or .eval()-state.
For instance, for batchnorm with running stats, there would be different behavior. In that case, I would like to have a function:
check_train_eval_difference(batchnorm()) -> True
For conv, which does not change:
check_train_eval_difference(conv()) -> False
Also, I forgot how it is typically called when the model shows different behavior. I read a specific-term to name this somewhere. Does anyone know?
I was more thinking of a version of this function that does not require sending input through the layers, but can simply analyse a network in advance (before running) whether it contains layers with different train eval behaviour. Ideally, such layers should have a fixed boolean attribute that indicates this. But if there is no such thing, I will go with the function you provided. Thanks!