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

Method forward

intermediate_source/torch_export_tutorial.py:969–971  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

967 self.linear = torch.nn.Linear(3, 3)
968
969 def forward(self, x):
970 x = self.linear(x)
971 return x
972
973inp = torch.randn(2, 3, device="cuda")
974m = M().to(device="cuda")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected