(self, s0, s1, drop_prob)
| 39 | self._indices = indices |
| 40 | |
| 41 | def forward(self, s0, s1, drop_prob): |
| 42 | s0 = self.preprocess0(s0) |
| 43 | s1 = self.preprocess1(s1) |
| 44 | |
| 45 | states = [s0, s1] |
| 46 | for i in range(self._steps): |
| 47 | h1 = states[self._indices[2*i]] |
| 48 | h2 = states[self._indices[2*i+1]] |
| 49 | op1 = self._ops[2*i] |
| 50 | op2 = self._ops[2*i+1] |
| 51 | h1 = op1(h1) |
| 52 | h2 = op2(h2) |
| 53 | if self.training and drop_prob > 0.: |
| 54 | if not isinstance(op1, Identity): |
| 55 | h1 = drop_path(h1, drop_prob) |
| 56 | if not isinstance(op2, Identity): |
| 57 | h2 = drop_path(h2, drop_prob) |
| 58 | s = h1 + h2 |
| 59 | states += [s] |
| 60 | return torch.cat([states[i] for i in self._concat], dim=1) |
| 61 | |
| 62 | |
| 63 | class AuxiliaryHeadCIFAR(nn.Module): |
nothing calls this directly
no test coverage detected