diff --git a/lib/Conversion/TorchToTosa/TorchToTosa.cpp b/lib/Conversion/TorchToTosa/TorchToTosa.cpp index 229265e95..faf73a691 100644 --- a/lib/Conversion/TorchToTosa/TorchToTosa.cpp +++ b/lib/Conversion/TorchToTosa/TorchToTosa.cpp @@ -3171,8 +3171,10 @@ LogicalResult ConvertAtenOp::matchAndRewrite( int64_t end; if (!matchPattern(op.getEnd(), m_TorchConstantInt(&end))) return rewriter.notifyMatchFailure(op, "end must be a Scalar constant"); + // support for end < 0 + end = toPositiveDim(end, selfType.getShape()[dim]); - // FIXME: add support for start/end < 0 and end < start + // FIXME: add support for start < 0 and end < start if (end < start) return rewriter.notifyMatchFailure(op, "Currently unsupported: end < start");