(self, point)
| 276 | ) |
| 277 | |
| 278 | def forward(self, point): |
| 279 | assert {"feat", "condition"}.issubset(point.keys()) |
| 280 | if isinstance(point.condition, str): |
| 281 | condition = point.condition |
| 282 | else: |
| 283 | condition = point.condition[0] |
| 284 | if self.decouple: |
| 285 | assert condition in self.conditions |
| 286 | norm = self.norm[self.conditions.index(condition)] |
| 287 | else: |
| 288 | norm = self.norm |
| 289 | point.feat = norm(point.feat) |
| 290 | if self.adaptive: |
| 291 | assert "context" in point.keys() |
| 292 | shift, scale = self.modulation(point.context).chunk(2, dim=1) |
| 293 | point.feat = point.feat * (1.0 + scale) + shift |
| 294 | return point |
| 295 | |
| 296 | |
| 297 | class RPE(torch.nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected