MaseGraph.from_module is a classmethod but accesses to self in line 226.
|
@classmethod |
|
def from_module( |
|
cls, |
|
model: torch.nn.Module, |
|
cf_args: Optional[Dict[str, Any]] = None, |
|
custom_ops: dict = {}, |
|
): |
|
assert isinstance( |
|
model, torch.nn.Module |
|
), f"model must be a torch.nn.Module. Received: {type(model)}" |
|
|
|
graph_module = self.trace_torch_module(model, cf_args, custom_ops) |
|
return cls(model=graph_module, cf_args=cf_args) |
MaseGraph.from_moduleis a classmethod but accesses toselfin line 226.mase/src/chop/ir/graph/mase_graph.py
Lines 215 to 227 in 784cc15