mirror of
https://github.com/huggingface/candle.git
synced 2025-06-20 12:06:35 +00:00
Experiment with resnet (#1128)
* Add some preliminary support for resnet. * Add an actual resnet example.
This commit is contained in:
@ -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) }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user