summaryrefslogtreecommitdiff
path: root/candle-core/src/cpu_backend.rs
diff options
context:
space:
mode:
authorMatt <Rocketknight1@users.noreply.github.com>2023-08-10 00:19:20 +0100
committerGitHub <noreply@github.com>2023-08-10 00:19:20 +0100
commit0dc1e5f387f91ff86cc8a4c09d5668e8baaab1b3 (patch)
tree922a5f1387c42b6101c98749211d5763529453d1 /candle-core/src/cpu_backend.rs
parent0cef3998fde542b9721215b77a80676a434b437f (diff)
parent25ec2d9f6bf36ff51c04f54f6c243828f6f4a8da (diff)
downloadcandle-0dc1e5f387f91ff86cc8a4c09d5668e8baaab1b3.tar.gz
candle-0dc1e5f387f91ff86cc8a4c09d5668e8baaab1b3.tar.bz2
candle-0dc1e5f387f91ff86cc8a4c09d5668e8baaab1b3.zip
Merge branch 'main' into readme_fixes
Diffstat (limited to 'candle-core/src/cpu_backend.rs')
-rw-r--r--candle-core/src/cpu_backend.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/candle-core/src/cpu_backend.rs b/candle-core/src/cpu_backend.rs
index 54f3f65b..238a9a69 100644
--- a/candle-core/src/cpu_backend.rs
+++ b/candle-core/src/cpu_backend.rs
@@ -1037,10 +1037,10 @@ impl<'a> Map2 for Conv1D<'a> {
let (inp_s0, inp_s1, inp_s2) = crate::shape::dims3(inp_l.stride())?;
let (k_s0, k_s1, k_s2) = crate::shape::dims3(k_l.stride())?;
let l_out = p.l_out();
- let dst_elems = p.c_out * l_out * p.b_size.unwrap_or(1);
+ let dst_elems = p.c_out * l_out * p.b_size;
let mut dst = vec![T::zero(); dst_elems];
// The output shape is [b_size, c_out, l_out]
- for b_idx in 0..p.b_size.unwrap_or(1) {
+ for b_idx in 0..p.b_size {
let inp_idx = b_idx * inp_s0;
let dst_idx = b_idx * p.c_out * l_out;
for dst_c_idx in 0..p.c_out {