diff options
author | jwnz <tkjones93@gmail.com> | 2023-11-10 00:09:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-09 16:09:01 +0100 |
commit | e6697471bb96a58a82b9a5ed71cb44b72e1564b2 (patch) | |
tree | 446dfa31b584fc2032c28ac1fa4894bb95829e02 /candle-nn | |
parent | 73d02f4f57c788c43f3e11991635bc15701c25c0 (diff) | |
download | candle-e6697471bb96a58a82b9a5ed71cb44b72e1564b2.tar.gz candle-e6697471bb96a58a82b9a5ed71cb44b72e1564b2.tar.bz2 candle-e6697471bb96a58a82b9a5ed71cb44b72e1564b2.zip |
Add weight and bias functions to LayerNorm (#1306)
Diffstat (limited to 'candle-nn')
-rw-r--r-- | candle-nn/src/layer_norm.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/candle-nn/src/layer_norm.rs b/candle-nn/src/layer_norm.rs index 7617fc6c..26800a7b 100644 --- a/candle-nn/src/layer_norm.rs +++ b/candle-nn/src/layer_norm.rs @@ -95,6 +95,14 @@ impl LayerNorm { eps, } } + + pub fn weight(&self) -> &Tensor { + &self.weight + } + + pub fn bias(&self) -> Option<&Tensor> { + self.bias.as_ref() + } } impl crate::Module for LayerNorm { |