mirror of
https://github.com/huggingface/candle.git
synced 2025-06-16 02:38:10 +00:00
Add Shape try into (#189)
* Add the TryInto trait for shapes. * Use the vectorized operations in block mode too.
This commit is contained in:
@ -315,7 +315,6 @@ impl BertSelfAttention {
|
||||
new_x_shape.pop();
|
||||
new_x_shape.push(self.num_attention_heads);
|
||||
new_x_shape.push(self.attention_head_size);
|
||||
// Be cautious about the transposition if adding a batch dim!
|
||||
let xs = xs.reshape(new_x_shape.as_slice())?.transpose(1, 2)?;
|
||||
xs.contiguous()
|
||||
}
|
||||
|
Reference in New Issue
Block a user