| 720 | |
| 721 | # PyTorch model for test cases --> Do not change the layers |
| 722 | class Torch_Model(nn.Module): |
| 723 | def __init__(self,): |
| 724 | super(Torch_Model, self).__init__() |
| 725 | self.convs = nn.Sequential( |
| 726 | nn.Conv2d(1, 32, 3), |
| 727 | nn.ReLU(), |
| 728 | nn.Conv2d(32, 64, 3), |
| 729 | nn.ReLU(), |
| 730 | nn.MaxPool2d(2), |
| 731 | nn.Dropout(0.25) |
| 732 | ) |
| 733 | self.fcs = nn.Sequential( |
| 734 | nn.Linear(12*12*64, 128), |
| 735 | nn.ReLU(), |
| 736 | nn.Dropout(0.5), |
| 737 | nn.Linear(128, 10), |
| 738 | ) |
| 739 | |
| 740 | def forward(self, x): |
| 741 | return x |
| 742 | |
| 743 | |
| 744 | class TestDropout(unittest.TestCase): |
no outgoing calls
searching dependent graphs…