Experiment with resnet (#1128)

* Add some preliminary support for resnet.

* Add an actual resnet example.
This commit is contained in:
Laurent Mazare
2023-10-19 09:25:03 +01:00
committed by GitHub
parent 87eb1658e1
commit 8e773cc0c6
4 changed files with 217 additions and 0 deletions

View File

@ -25,3 +25,12 @@ impl<'a> super::Module for Func<'a> {
(*self.f)(xs)
}
}
impl<'a> Func<'a> {
pub fn new<F>(f: F) -> Self
where
F: 'a + Fn(&Tensor) -> Result<Tensor> + Send,
{
Self { f: Box::new(f) }
}
}