summaryrefslogtreecommitdiff
path: root/candle-nn/src/layer_norm.rs
diff options
context:
space:
mode:
authorLaurent Mazare <laurent.mazare@gmail.com>2023-07-22 11:39:27 +0200
committerGitHub <noreply@github.com>2023-07-22 10:39:27 +0100
commit43c72232927ca80c850a73ce977c2063d5a2dcf5 (patch)
treec93c07984e06b1925313f4f641a8b1a3956fc0ed /candle-nn/src/layer_norm.rs
parent52c5d8c087f6a2ee91b807467860eb3e96bb6267 (diff)
downloadcandle-43c72232927ca80c850a73ce977c2063d5a2dcf5.tar.gz
candle-43c72232927ca80c850a73ce977c2063d5a2dcf5.tar.bz2
candle-43c72232927ca80c850a73ce977c2063d5a2dcf5.zip
Rename the .r functions to .dims so as to be a bit more explicit. (#220)
Diffstat (limited to 'candle-nn/src/layer_norm.rs')
-rw-r--r--candle-nn/src/layer_norm.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/candle-nn/src/layer_norm.rs b/candle-nn/src/layer_norm.rs
index 88d5ab32..8f8544bb 100644
--- a/candle-nn/src/layer_norm.rs
+++ b/candle-nn/src/layer_norm.rs
@@ -49,7 +49,7 @@ impl LayerNorm {
DType::F16 | DType::BF16 => DType::F32,
d => d,
};
- let (_bsize, _seq_len, hidden_size) = x.shape().r3()?;
+ let (_bsize, _seq_len, hidden_size) = x.dims3()?;
let x = x.to_dtype(internal_dtype)?;
let mean_x = (x.sum_keepdim(2)? / hidden_size as f64)?;
let x = x.broadcast_sub(&mean_x)?;