MCPcopy Index your code
hub / github.com/apache/tvm / __call__

Method __call__

python/tvm/script/parser/ir/entry.py:116–131  ·  view source on GitHub ↗
(self, device=None, target=None)

Source from the content-addressed store, hash-verified

114 self.original_class = original_class
115
116 def __call__(self, device=None, target=None):
117 if device is None:
118 device = cpu(0)
119
120 instance_ir_mod = ir.IRModule()
121 for global_var, func in self.ir_module.functions_items():
122 instance_ir_mod[global_var] = func
123
124 instance = BasePyModule(instance_ir_mod, device, target)
125
126 for method_name in self.pyfunc_methods:
127 if hasattr(self.original_class, method_name):
128 method = getattr(self.original_class, method_name)
129 instance.add_python_function(method_name, method)
130
131 return instance
132
133 def __getattr__(self, name):
134 if hasattr(self.ir_module, name):

Callers

nothing calls this directly

Calls 4

add_python_functionMethod · 0.95
cpuFunction · 0.90
BasePyModuleClass · 0.90
functions_itemsMethod · 0.80

Tested by

no test coverage detected