Decoder.register_load_state_dict_pre_hook

Decoder.register_load_state_dict_pre_hook(hook)[source]

Register a pre-hook to be run before module’s load_state_dict() is called.

It should have the following signature::

hook(module, state_dict, prefix, local_metadata, strict, missing_keys, unexpected_keys, error_msgs) -> None # noqa: B950

Arguments:
hook (Callable): Callable hook that will be invoked before

loading the state dict.