MCPcopy Create free account
hub / github.com/pytorch/tutorials / forward

Method forward

intermediate_source/torch_export_tutorial.py:232–236  ·  view source on GitHub ↗
(self, xs, y, z)

Source from the content-addressed store, hash-verified

230
231class MapModule(torch.nn.Module):
232 def forward(self, xs, y, z):
233 def body(x, y, z):
234 return x + y + z
235
236 return torch_map(body, xs, y, z)
237
238inps = (torch.ones(6, 4), torch.tensor(5), torch.tensor(4))
239exported_map_example = export(MapModule(), inps)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected