returnn.torch.util.module
¶
Utils for modules
- returnn.torch.util.module.convert_parameters_to_buffers(module: Module, parameter_names: Collection[str], *, deep: bool = True, persistent: bool)[source]¶
- Parameters:
module
parameter_names
deep – parameter_name can contain ‘.’ to access submodules
persistent – whether the buffer is persistent. if True, the buffer will be saved to the state_dict. passed to module.register_buffer.
- returnn.torch.util.module.convert_parameter_to_buffer(module: Module, parameter_name: str, *, deep: bool = True, persistent: bool)[source]¶
- Parameters:
module
parameter_name
deep – parameter_name can contain ‘.’ to access submodules
persistent – whether the buffer is persistent. if True, the buffer will be saved to the state_dict. passed to module.register_buffer.