(self, d_model, nhead, dropout=0.0,
activation="relu", normalize_before=False)
| 70 | class CrossAttentionLayer(nn.Module): |
| 71 | |
| 72 | def __init__(self, d_model, nhead, dropout=0.0, |
| 73 | activation="relu", normalize_before=False): |
| 74 | super().__init__() |
| 75 | self.multihead_attn = nn.MultiheadAttention(d_model, nhead, dropout=dropout) |
| 76 | |
| 77 | self.norm = nn.LayerNorm(d_model) |
| 78 | self.dropout = nn.Dropout(dropout) |
| 79 | |
| 80 | self.activation = _get_activation_fn(activation) |
| 81 | self.normalize_before = normalize_before |
| 82 | |
| 83 | self._reset_parameters() |
| 84 | |
| 85 | def _reset_parameters(self): |
| 86 | for p in self.parameters(): |
nothing calls this directly
no test coverage detected