(self, x)
| 92 | self.mode = mode |
| 93 | |
| 94 | def forward(self, x): |
| 95 | outputs = [] |
| 96 | for model in self.models: |
| 97 | outputs.append(model(x)) |
| 98 | outputs = torch.stack(outputs, dim=0) |
| 99 | if self.mode == 'mean': |
| 100 | outputs = torch.mean(outputs, dim=0) |
| 101 | return outputs |
| 102 | elif self.mode == 'ind': |
| 103 | return outputs |
| 104 | else: |
| 105 | raise NotImplementedError |
| 106 | |
| 107 | |
| 108 | class AdvDataset(torch.utils.data.Dataset): |
nothing calls this directly
no outgoing calls
no test coverage detected