From c11c74f74432719fd9f7f835b642f8b228175941 Mon Sep 17 00:00:00 2001 From: Mathieu Poumeyrol Date: Thu, 21 Sep 2023 16:23:24 +0200 Subject: [PATCH] i32::max means end too --- core/src/ops/array/strided_slice.rs | 2 +- hir/src/ops/array/strided_slice.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/ops/array/strided_slice.rs b/core/src/ops/array/strided_slice.rs index 36fa96fba1..822b3ba078 100644 --- a/core/src/ops/array/strided_slice.rs +++ b/core/src/ops/array/strided_slice.rs @@ -62,7 +62,7 @@ impl StridedSlice { None } else if end.datum_type() == i64::datum_type() { let end = *end.as_slice::()?.get(ix).unwrap(); - if end == std::i64::MAX || end == std::i64::MIN || end == std::i64::MIN + 1 { + if end == std::i64::MAX || end == std::i64::MIN || end == std::i64::MIN + 1 || end == std::i32::MAX as _ { None } else { Some(end.to_dim()) diff --git a/hir/src/ops/array/strided_slice.rs b/hir/src/ops/array/strided_slice.rs index 8f3441290d..66340bdfd3 100644 --- a/hir/src/ops/array/strided_slice.rs +++ b/hir/src/ops/array/strided_slice.rs @@ -72,6 +72,7 @@ impl InferenceRulesOp for StridedSlice { for (ix, axis) in axes.into_iter().enumerate() { let preped = self.prepare_one_dim(ix, &input_shape[axis], begin, end, &strides)?; + dbg!(&preped); output_shape[axis] = preped.soft_len()?; if preped.shrink { shrink.push(axis);