(self, inputs)
| 114 | return torch.cat(layer_outputs, dim=1) + inputs |
| 115 | |
| 116 | def forward_cat(self, inputs): |
| 117 | x0 = self.layers[0](inputs) |
| 118 | layer_outputs = [x0] |
| 119 | for i, layer in enumerate(self.layers[1:]): |
| 120 | if i == 0: |
| 121 | if self.with_downsample: |
| 122 | x = layer(self.downsample(x0)) |
| 123 | else: |
| 124 | x = layer(x0) |
| 125 | else: |
| 126 | x = layer(x) |
| 127 | layer_outputs.append(x) |
| 128 | if self.with_downsample: |
| 129 | layer_outputs[0] = self.skip(x0) |
| 130 | return torch.cat(layer_outputs, dim=1) |
| 131 | |
| 132 | |
| 133 | class FeatureFusionModule(BaseModule): |