Add more of the conv1d op.

This commit is contained in:
laurent
2023-07-04 11:15:45 +01:00
parent 3aac1047fe
commit a424d95473
8 changed files with 52 additions and 19 deletions

View File

@ -149,18 +149,17 @@ impl Storage {
l: &Layout,
kernel: &Self,
kernel_l: &Layout,
padding: usize,
stride: usize,
params: &crate::conv::ParamsConv1D,
) -> Result<Self> {
self.same_device(kernel, "conv1d")?;
self.same_dtype(kernel, "conv1d")?;
match (self, &kernel) {
(Storage::Cpu(inp), Storage::Cpu(kernel)) => {
let s = inp.conv1d(l, kernel, kernel_l, padding, stride)?;
let s = inp.conv1d(l, kernel, kernel_l, params)?;
Ok(Self::Cpu(s))
}
(Storage::Cuda(inp), Storage::Cuda(kernel)) => {
let s = inp.conv1d(l, kernel, kernel_l, padding, stride)?;
let s = inp.conv1d(l, kernel, kernel_l, params)?;
Ok(Self::Cuda(s))
}
(lhs, rhs) => Err(Error::DeviceMismatchBinaryOp {