Allow for different behavior between training and eval (#1213)

* Forward with training.

* Do not use dropout on vgg evaluation.
This commit is contained in:
Laurent Mazare
2023-10-29 07:53:09 +01:00
committed by GitHub
parent dece37c6f4
commit 55bc3382cf
8 changed files with 83 additions and 22 deletions

View File

@ -84,6 +84,12 @@ impl Dropout {
}
}
impl candle::ModuleT for Dropout {
fn forward_t(&self, xs: &Tensor, train: bool) -> Result<Tensor> {
self.forward(xs, train)
}
}
struct SoftmaxLastDim;
impl candle::CustomOp1 for SoftmaxLastDim {