Expose the weights and biases in transposed convolutions. (#1727)

This commit is contained in:
Laurent Mazare
2024-02-18 10:35:01 +01:00
committed by GitHub
parent 41416d2376
commit 678d44a7f6

View File

@ -109,6 +109,14 @@ impl ConvTranspose1d {
pub fn config(&self) -> &ConvTranspose1dConfig { pub fn config(&self) -> &ConvTranspose1dConfig {
&self.config &self.config
} }
pub fn weight(&self) -> &Tensor {
&self.weight
}
pub fn bias(&self) -> Option<&Tensor> {
self.bias.as_ref()
}
} }
impl crate::Module for ConvTranspose1d { impl crate::Module for ConvTranspose1d {
@ -258,6 +266,14 @@ impl ConvTranspose2d {
pub fn config(&self) -> &ConvTranspose2dConfig { pub fn config(&self) -> &ConvTranspose2dConfig {
&self.config &self.config
} }
pub fn weight(&self) -> &Tensor {
&self.weight
}
pub fn bias(&self) -> Option<&Tensor> {
self.bias.as_ref()
}
} }
impl crate::Module for ConvTranspose2d { impl crate::Module for ConvTranspose2d {