diff options
author | Laurent Mazare <laurent.mazare@gmail.com> | 2023-09-03 19:27:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-03 18:27:48 +0100 |
commit | 26cd266e6569b0640947d4cacb4d6b9c27c01623 (patch) | |
tree | cb7fa82b7bb5978d69506d00d10cd35b4211cd40 /candle-nn | |
parent | bbec527bb966b5050a9f8a3fe1382ea929e39d41 (diff) | |
download | candle-26cd266e6569b0640947d4cacb4d6b9c27c01623.tar.gz candle-26cd266e6569b0640947d4cacb4d6b9c27c01623.tar.bz2 candle-26cd266e6569b0640947d4cacb4d6b9c27c01623.zip |
Musicgen text embeddings. (#726)
* Musicgen text embeddings.
* Bugfix for layer norm.
* Proper position bias.
* Expose the weights.
Diffstat (limited to 'candle-nn')
-rw-r--r-- | candle-nn/src/linear.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/candle-nn/src/linear.rs b/candle-nn/src/linear.rs index 14250ed2..7028f68c 100644 --- a/candle-nn/src/linear.rs +++ b/candle-nn/src/linear.rs @@ -29,6 +29,14 @@ impl Linear { pub fn new(weight: Tensor, bias: Option<Tensor>) -> Self { Self { weight, bias } } + + pub fn weight(&self) -> &Tensor { + &self.weight + } + + pub fn bias(&self) -> Option<&Tensor> { + self.bias.as_ref() + } } impl super::Module for Linear { |