(self, inputs)
| 125 | self.stochastic_depth_drop_prob = stochastic_depth_drop_prob |
| 126 | |
| 127 | def forward(self, inputs): |
| 128 | x = inputs |
| 129 | shortcut = None |
| 130 | |
| 131 | for block in self.DDCNN: |
| 132 | x = block(x) |
| 133 | if shortcut is None: |
| 134 | shortcut = x |
| 135 | |
| 136 | x = functional.relu(x) |
| 137 | |
| 138 | if self.shortcut is not None: |
| 139 | if self.stochastic_depth_drop_prob != 0.: |
| 140 | if self.training: |
| 141 | if random.random() < self.stochastic_depth_drop_prob: |
| 142 | x = shortcut |
| 143 | else: |
| 144 | x = x + shortcut |
| 145 | else: |
| 146 | x = (1 - self.stochastic_depth_drop_prob) * x + shortcut |
| 147 | else: |
| 148 | x += shortcut |
| 149 | |
| 150 | x = self.pool(x) |
| 151 | return x |
| 152 | |
| 153 | |
| 154 | class DilatedDCNNV2(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected