class_docstr: Manage your param op hooks. It only has static methods.
  The only static method you should call is ``use_hooks(*hooks)``.
class_docstr_tok: ["Manage","your","param","op","hooks",".","It","only","has","static","methods",".","The","only","static","method","you","should","call","is","``","use_hooks","(","*","hooks",")","``","."]
docstr: Change the param op hooks you use. Nested calling is allowed.
  
  Example:
      >>> with ColoParamOpHookManager.use_hooks(*hooks):
      >>>     do_something()
      >>>     with ColoParamOpHookManager.use_hooks():
      >>>         // clear hooks
      >>>         do_something()
docstr_tok: ["Change","the","param","op","hooks","you","use",".","Nested","calling","is","allowed",".","Example",":",">",">",">","with","ColoParamOpHookManager.use_hooks","(","*","hooks",")",":",">",">",">","do_something","(",")",">",">",">","with","ColoParamOpHookManager.use_hooks","(",")",":",">",">",">","\/\/","clear","hooks",">",">",">","do_something","(",")"]
code: def use_hooks(*hooks: ColoParamOpHook):
      """Change the param op hooks you use. Nested calling is allowed.
  
      Example:
          >>> with ColoParamOpHookManager.use_hooks(*hooks):
          >>>     do_something()
          >>>     with ColoParamOpHookManager.use_hooks():
          >>>         // clear hooks
          >>>         do_something()
      """
      try:
          old_param_op_hooks = ColoParamOpHookManager.hooks
          ColoParamOpHookManager.hooks = hooks
          yield
      finally:
          ColoParamOpHookManager.hooks = old_param_op_hooks
  
imports: from abc import ABC, abstractmethod
  from contextlib import contextmanager
  from typing import Any, List, Tuple
  import torch
  from torch.utils._pytree import TreeSpec, tree_flatten, tree_unflatten
label_desc: Use image node_id 1 for calling the ColoParamOpHookManager obj's underlying member method code with example usage: obj.use_hooks() without return types