MLP based model
| 45 | from torch.distributed._tensor.device_mesh import init_device_mesh |
| 46 | |
| 47 | class ToyModel(nn.Module): |
| 48 | """MLP based model""" |
| 49 | |
| 50 | def __init__(self): |
| 51 | super().__init__() |
| 52 | self.in_proj = nn.Linear(10, 32) |
| 53 | self.relu = nn.ReLU() |
| 54 | self.out_proj = nn.Linear(32, 5) |
| 55 | |
| 56 | def forward(self, x): |
| 57 | return self.out_proj(self.relu(self.in_proj(x))) |
| 58 | |
| 59 | |
| 60 | """ |
no outgoing calls
no test coverage detected