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

Class ModuleAddWithDevice

test/models/export_program_with_device_info.py:78–85  ·  view source on GitHub ↗

Simple add model — the add op will be delegated with CUDA device annotation.

Source from the content-addressed store, hash-verified

76
77
78class ModuleAddWithDevice(nn.Module):
79 """Simple add model — the add op will be delegated with CUDA device annotation."""
80
81 def forward(self, a: torch.Tensor, b: torch.Tensor) -> torch.Tensor:
82 return torch.add(a, b)
83
84 def get_random_inputs(self):
85 return (torch.randn(2, 2), torch.randn(2, 2))
86
87
88def main() -> None:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected