bug: setitem_gopt failed when reversing an array

This commit is contained in:
lzhengning 2021-04-30 13:29:37 +08:00
parent 35f06bfa87
commit 295393b556
1 changed files with 3 additions and 1 deletions

View File

@ -196,8 +196,10 @@ static void getitem_inplace(GetitemOp* op) {
auto size = 0;
if (s.is_int())
size = s.i * in->size / in_shape[0];
else if (s.is_slice())
else if (s.is_slice()) {
size = s.slice.start * in->size / in_shape[0];
if (s.slice.step != 1) return;
}
ou->share_with(in, size);
// LOGir << "pass getitem_inplace";
}