(self, x, hw_shape, identity=None)
| 80 | dropout_layer) if dropout_layer else torch.nn.Identity() |
| 81 | |
| 82 | def forward(self, x, hw_shape, identity=None): |
| 83 | out = nlc_to_nchw(x, hw_shape) |
| 84 | out = self.layers(out) |
| 85 | out = nchw_to_nlc(out) |
| 86 | if identity is None: |
| 87 | identity = x |
| 88 | return identity + self.dropout_layer(out) |
| 89 | |
| 90 | |
| 91 | class EfficientMultiheadAttention(MultiheadAttention): |
nothing calls this directly
no outgoing calls
no test coverage detected