MCPcopy Create free account
hub / github.com/pytorch/examples / ToyModel

Class ToyModel

distributed/ddp/example.py:20–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 return has_gpu and gpu_count >= min_gpus
19
20class ToyModel(nn.Module):
21 def __init__(self):
22 super(ToyModel, self).__init__()
23 self.net1 = nn.Linear(10, 10)
24 self.relu = nn.ReLU()
25 self.net2 = nn.Linear(10, 5)
26
27 def forward(self, x):
28 return self.net2(self.relu(self.net1(x)))
29
30
31def demo_basic(rank):

Callers 1

demo_basicFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected