(self, device=None, target=None)
| 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): |
nothing calls this directly
no test coverage detected