code: def count_ops(expr):
      """count number of times a given op is called in the graph"""
  
      class OpCounter(tvm.relay.ExprVisitor):
          """OpCounter"""
  
          def visit_call(self, call):
              if hasattr(call, "op"):
                  self.node_counter[call.op.name] += 1
              return super().visit_call(call)
  
          def count(self, expr):
              self.node_set = {}
              self.node_counter = collections.Counter()
              self.visit(expr)
              return self.node_counter
  
      return OpCounter().count(expr)
  
imports: from __future__ import absolute_import
  import collections
  import numpy
  import tvm
  from tvm import te
  from tvm import relay
  from tvm.relay import op
  from tvm.relay.prelude import Prelude
  from tvm.testing import enabled_targets
  from .None import mlp
  from .None import resnet
  from .None import resnet_3d
  from .None import dqn
  from .None import dcgan
  from .None import mobilenet
  from .None import lstm
  from .None import inception_v3
  from .None import squeezenet
  from .None import vgg
  from .None import densenet
  from .None import yolo_detection
  from .None import temp_op_attr
  from .None import synthetic
  from .init import create_workload
  from .nat import count, make_nat_value, make_nat_expr
  from .py_converter import to_python, run_as_python
  from ..transform import gradient
label_desc: Use image node_id 6 for calling a global function with example usage: count_ops(expr) and returns: OpCounter, super, self