(self)
| 337 | @register_class |
| 338 | class PReLU(CaffeOpBuilder): |
| 339 | def trans(self): |
| 340 | assert len(self.layer.blobs) == 1, 'PReLU lacks of slope' |
| 341 | dim_info = self.layer.blobs[0].shape.dim |
| 342 | # squeeze the PReLU slope [1, 128, 1, 1] to [1, 128] if input is 2-D |
| 343 | # prelu only has one input data |
| 344 | if len(dim_info) == 4 and len(self.input_shape[0]) == 2: |
| 345 | dim_info.pop() |
| 346 | dim_info.pop() |
| 347 | return super(PReLU, self).trans() |
| 348 | |
| 349 | |
| 350 | @register_class |