CPU implementation for upsample-nearest2d. (#339)

This commit is contained in:
Laurent Mazare
2023-08-07 21:07:10 +02:00
committed by GitHub
parent fc265d9dcf
commit d0d7010682
5 changed files with 61 additions and 7 deletions

View File

@ -284,13 +284,17 @@ impl Storage {
}
}
pub(crate) fn upsample_nearest2d(
&self,
_layout: &Layout,
_h: usize,
_w: usize,
) -> Result<Self> {
todo!()
pub(crate) fn upsample_nearest2d(&self, layout: &Layout, h: usize, w: usize) -> Result<Self> {
match self {
Storage::Cpu(storage) => {
let storage = storage.upsample_nearest2d(layout, h, w)?;
Ok(Self::Cpu(storage))
}
Self::Cuda(storage) => {
let storage = storage.upsample_nearest2d(layout, h, w)?;
Ok(Self::Cuda(storage))
}
}
}
pub(crate) fn where_cond(