From 60676780a9436fd0de43b1e8ff99445ab863c066 Mon Sep 17 00:00:00 2001 From: Hugo Abonizio Date: Mon, 25 Mar 2024 14:20:09 -0300 Subject: [PATCH] Fix detail in new RoPE implementation (#1935) --- candle-nn/src/rotary_emb.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/candle-nn/src/rotary_emb.rs b/candle-nn/src/rotary_emb.rs index 9c5543fb..c2b41482 100644 --- a/candle-nn/src/rotary_emb.rs +++ b/candle-nn/src/rotary_emb.rs @@ -455,7 +455,7 @@ impl candle::CustomOp3 for RotaryEmb { pub fn rope(xs: &Tensor, cos: &Tensor, sin: &Tensor) -> Result { let (_b_sz, _n_head, seq_len, n_embd) = xs.dims4()?; let (cos_seq_len, cos_n_embd) = cos.dims2()?; - let (sin_seq_len, sin_n_embd) = cos.dims2()?; + let (sin_seq_len, sin_n_embd) = sin.dims2()?; if cos_n_embd * 2 != n_embd || sin_n_embd * 2 != n_embd || seq_len > cos_seq_len