Make func cloneable. (#1137)

This commit is contained in:
Laurent Mazare
2023-10-20 16:28:50 +01:00
committed by GitHub
parent 99cf13e8e2
commit 7366aeac21
3 changed files with 9 additions and 7 deletions

View File

@ -44,7 +44,7 @@ impl Sequential {
/// Appends a closure after all the current layers.
pub fn add_fn<F>(self, f: F) -> Self
where
F: 'static + Fn(&Tensor) -> Result<Tensor> + Send,
F: 'static + Fn(&Tensor) -> Result<Tensor> + Send + Sync,
{
self.add(super::func(f))
}