mindspore.nn.utils.hooks.RemovableHandle

View Source On Gitee
class mindspore.nn.utils.hooks.RemovableHandle(hooks_dict: Any, *, extra_dict: Any = None)[source]

A handle which provides the capability to remove a hook.

Parameters

hooks_dict (dict) – A dictionary of hooks, indexed by hook id.

Keyword Arguments

extra_dict (Union[dict, List[dict]], optional) – An additional dictionary or list of dictionaries whose keys will be deleted when the same keys are removed from hooks_dict. Default None.