Musicgen text embeddings. (#726)

* Musicgen text embeddings.

* Bugfix for layer norm.

* Proper position bias.

* Expose the weights.
This commit is contained in:
Laurent Mazare
2023-09-03 19:27:48 +02:00
committed by GitHub
parent bbec527bb9
commit 26cd266e65
4 changed files with 85 additions and 15 deletions

View File

@ -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 {