Skip to content

Commit

Permalink
Add weight and bias functions to LayerNorm (#1306)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwnz authored Nov 9, 2023
1 parent 73d02f4 commit e669747
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions candle-nn/src/layer_norm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e669747

Please sign in to comment.