MCPcopy Create free account
hub / github.com/pytorch/executorch / transform

Method transform

backends/xnnpack/_passes/__init__.py:96–111  ·  view source on GitHub ↗

Returns a transformed ExportedProgram

(self)

Source from the content-addressed store, hash-verified

94 return self._exported_program
95
96 def transform(self) -> ExportedProgram:
97 """
98 Returns a transformed ExportedProgram
99 """
100 ep = self.exported_program
101 for pass_ in self.passes:
102 if issubclass(pass_, XNNPACKPass):
103 transform_pass = pass_(ep)
104 elif issubclass(pass_, ExportPass):
105 transform_pass = pass_()
106 else:
107 raise RuntimeError(
108 f"Expecting ExportPass or ExportPass(), but got pass: {pass_} with type: {type(pass_)}"
109 )
110 ep = _transform(ep, transform_pass)
111 return ep

Calls 1

_transformFunction · 0.90