returnn.__old_mod_loader__
#
This provides lazy module wrappers such that old-style RETURNN-as-a-framework imports are still working. E.g. like:
import returnn.TFUtil
import returnn.TFNativeOp
Some old RETURNN configs also might directly have imports like:
import TFUtil
import TFHorovod
This is supported as well.
- returnn.__old_mod_loader__.setup(package_name='returnn', modules=None)[source]#
This does the setup, such that all the modules become available in the returnn package. It does not import all the modules now, but instead provides them lazily.
- Parameters:
package_name (str) – “returnn” by default
modules (dict[str,types.ModuleType]|None) – if set, will do
modules[old_mod_name] = mod