MCPcopy Create free account
hub / github.com/Trustworthy-AI-Group/TransferAttack / forward

Method forward

transferattack/utils.py:94–105  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

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
108class AdvDataset(torch.utils.data.Dataset):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected