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",")","``","."]
code: def pre_op(params: List[torch.Tensor], *args: Any) -> list:
      ColoParamOpHookManager._trigger_pre_forward(params)
      # auto grad function can only recognize torch.Tensor, thus we have to flatten the input
      # if one of the input requires grad, all the output will be treated as requires grad
      # and will have grad fn even the corresponding input does not require grad
      # we have to extract tensors requiring grad into flat list and then merge them back
      grad_args, other_args, grad_flags, spec = _flatten_grad_args(args)
      new_grad_args = PreFwdPostBwd.apply(params, *grad_args)
      return _merge_args(new_grad_args, other_args, grad_flags, spec)
  
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 6 for calling the ColoParamOpHookManager obj's underlying member method code with example usage: obj.pre_op(params) and returns: _merge_args