Add 1d upsampling. (#839)

* Add 1d upsampling.

* Add the interpolate functions.
This commit is contained in:
Laurent Mazare
2023-09-13 17:50:39 +02:00
committed by GitHub
parent 31ab2ddaeb
commit 9a465e1b26
8 changed files with 86 additions and 2 deletions

View File

@ -369,6 +369,19 @@ impl Storage {
}
}
pub(crate) fn upsample_nearest1d(&self, layout: &Layout, sz: usize) -> Result<Self> {
match self {
Storage::Cpu(storage) => {
let storage = storage.upsample_nearest1d(layout, sz)?;
Ok(Self::Cpu(storage))
}
Self::Cuda(storage) => {
let storage = storage.upsample_nearest1d(layout, sz)?;
Ok(Self::Cuda(storage))
}
}
}
pub(crate) fn upsample_nearest2d(&self, layout: &Layout, h: usize, w: usize) -> Result<Self> {
match self {
Storage::Cpu(storage) => {