()
| 148 | |
| 149 | |
| 150 | def get_exported_programs() -> Dict[str, ExportedProgram]: |
| 151 | class Forward(torch.nn.Module): |
| 152 | def forward(self, x: torch.Tensor, y: torch.Tensor) -> torch.Tensor: |
| 153 | z = torch.mul(x, y) |
| 154 | return torch.add(z, x) |
| 155 | |
| 156 | forward = Forward() |
| 157 | |
| 158 | class Foo(torch.nn.Module): |
| 159 | def forward(self, x: torch.Tensor) -> torch.Tensor: |
| 160 | return torch.add(x, torch.ones(1)) |
| 161 | |
| 162 | foo = Foo() |
| 163 | |
| 164 | programs = {} |
| 165 | programs["forward"] = export( |
| 166 | forward, |
| 167 | args=( |
| 168 | torch.ones(1), |
| 169 | torch.zeros(1), |
| 170 | ), |
| 171 | strict=True, |
| 172 | ).run_decompositions() |
| 173 | programs["foo"] = export(foo, (torch.ones(1),), strict=True).run_decompositions() |
| 174 | return programs |
| 175 | |
| 176 | |
| 177 | def get_config_methods() -> Dict[str, Any]: |
no test coverage detected