Skip to content

Commit

Permalink
Expose the weights and biases in transposed convolutions. (#1727)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare authored Feb 18, 2024
1 parent 41416d2 commit 678d44a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions candle-nn/src/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ impl ConvTranspose1d {
pub fn config(&self) -> &ConvTranspose1dConfig {
&self.config
}

pub fn weight(&self) -> &Tensor {
&self.weight
}

pub fn bias(&self) -> Option<&Tensor> {
self.bias.as_ref()
}
}

impl crate::Module for ConvTranspose1d {
Expand Down Expand Up @@ -258,6 +266,14 @@ impl ConvTranspose2d {
pub fn config(&self) -> &ConvTranspose2dConfig {
&self.config
}

pub fn weight(&self) -> &Tensor {
&self.weight
}

pub fn bias(&self) -> Option<&Tensor> {
self.bias.as_ref()
}
}

impl crate::Module for ConvTranspose2d {
Expand Down

0 comments on commit 678d44a

Please sign in to comment.