(self)
| 113 | return HOOKS_DEFAULT['attention_forward'](self, hidden_states, mask, **kw_args) |
| 114 | |
| 115 | def repartition(self): |
| 116 | world_size = get_model_parallel_world_size() |
| 117 | self.num_attention_heads_per_partition = divide(self.num_attention_heads, world_size) |
| 118 | self.hidden_size_per_partition = self.hidden_size_per_attention_head * self.num_attention_heads_per_partition |
| 119 | |
| 120 | class CrossAttention(torch.nn.Module): |
| 121 | """Parallel cross-attention layer for Transformer""" |
nothing calls this directly
no test coverage detected