class_docstr: Execute an FX graph Node-by-Node and record the meta data of the result
  into the corresponding node.
  
  Usage:
      >>> model = MyModule()
      >>> x = torch.rand(10, 10)
      >>> gm = colossalai.fx.symbolic_trace(model, meta_args = {'x': x}})
      >>> shape_interp = ShapeProp(gm)    # must do this first
      >>> shape_interp.propagate(x)
      >>> profiler = FlopProfiler(gm)
      >>> profiler.propagate(x)
  
  Args:
      module (GraphModule): The module to be executed
  
  Hints:
      If you want to add a new flop count rule, you can first
      check the existing files in ``../_subclasses/flop_tensor.py``.
      If your flop count rules are incompatible with the existing
      ones, you can do so by adding a new method to this class
      with the ``@register_flop_count_impl`` decorator. The method
      should take (*args, **kwargs) instance as its input and
      generate flop count for both forward and backward as its
      output.
  
      For example, if you want to add a flop count rule for
      ``my_fn``, which is a hand-written operand not detected by
      PyTorch, you can do so by adding a new method to this
      class with the ``@register_flop_count_impl`` decorator:
  
      >>> @register_flop_count_impl(my_fn)
      >>> def my_fn_flop_count_impl(*args, **kwargs):
      >>>     return 0, 0
class_docstr_tok: ["Execute","an","FX","graph","Node-by-Node","and","record","the","meta","data","of","the","result","into","the","corresponding","node",".","Usage",":",">",">",">","model","=","MyModule","(",")",">",">",">","x","=","torch.rand","(","10",",","10",")",">",">",">","gm","=","colossalai.fx.symbolic_trace","(","model",",","meta_args","=","{","'","x","'",":","x","}","}",")",">",">",">","shape_interp","=","ShapeProp","(","gm",")","#","must","do","this","first",">",">",">","shape_interp.propagate","(","x",")",">",">",">","profiler","=","FlopProfiler","(","gm",")",">",">",">","profiler.propagate","(","x",")","Args",":","module","(","GraphModule",")",":","The","module","to","be","executed","Hints",":","If","you","want","to","add","a","new","flop","count","rule",",","you","can","first","check","the","existing","files","in","``","..","\/_subclasses\/flop_tensor.py","``",".","If","your","flop","count","rules","are","incompatible","with","the","existing","ones",",","you","can","do","so","by","adding","a","new","method","to","this","class","with","the","``","@","register_flop_count_impl","``","decorator",".","The","method","should","take","(","*","args",",","*","*","kwargs",")","instance","as","its","input","and","generate","flop","count","for","both","forward","and","backward","as","its","output",".","For","example",",","if","you","want","to","add","a","flop","count","rule","for","``","my_fn","``",",","which","is","a","hand-written","operand","not","detected","by","PyTorch",",","you","can","do","so","by","adding","a","new","method","to","this","class","with","the","``","@","register_flop_count_impl","``","decorator",":",">",">",">","@","register_flop_count_impl","(","my_fn",")",">",">",">","def","my_fn_flop_count_impl","(","*","args",",","*","*","kwargs",")",":",">",">",">","return","0",",","0"]
docstr: Execute a ``call_method`` node and return the profiling result.
  
  Args:
      target (Target): The call target for this node. See
          `Node <https://pytorch.org/docs/master/fx.html#torch.fx.Node>`__ for
          details on semantics
      args (Tuple): Tuple of positional args for this invocation
      kwargs (Dict): Dict of keyword arguments for this invocation
  
  Return
      flop_count (Tuple[int]): (fwd_flop, bwd_flop)
docstr_tok: ["Execute","a","``","call_method","``","node","and","return","the","profiling","result",".","Args",":","target","(","Target",")",":","The","call","target","for","this","node",".","See","`","Node","<","https",":","\/\/pytorch.org\/docs\/master\/fx.html","#","torch.fx.Node",">","`","__","for","details","on","semantics","args","(","Tuple",")",":","Tuple","of","positional","args","for","this","invocation","kwargs","(","Dict",")",":","Dict","of","keyword","arguments","for","this","invocation","Return","flop_count","(","Tuple","[","int","]",")",":","(","fwd_flop",",","bwd_flop",")"]
code: def call_method(
      self,
      target: "Target",
      args: Tuple[Argument, ...],
      kwargs: Dict[str, Any],
  ) -> Any:
      """
      Execute a ``call_method`` node and return the profiling result.
  
      Args:
          target (Target): The call target for this node. See
              `Node <https://pytorch.org/docs/master/fx.html#torch.fx.Node>`__ for
              details on semantics
          args (Tuple): Tuple of positional args for this invocation
          kwargs (Dict): Dict of keyword arguments for this invocation
  
      Return
          flop_count (Tuple[int]): (fwd_flop, bwd_flop)
      """
      # Execute the method and return the result
      assert isinstance(target, str)
      return flop_count(getattr(torch.Tensor, target), *args, **kwargs)
  
imports: from typing import Any, Dict, Iterator, List, Optional, Tuple
  import torch
  import torch.fx
  from torch.autograd.profiler_util import _format_memory
  from torch.fx import GraphModule
  from torch.fx.node import Argument, Node, Target
  from colossalai._analyzer._subclasses import flop_count
  from colossalai._analyzer.fx.node_util import MetaInfo
label_desc: Use image node_id 3 for calling the FlopProfiler obj's underlying member method code with example usage: obj.call_method(target, args, kwargs) and returns: flop_count