Merge pull request #204 from Jittor/lstm

[Bug fix]: setter_gopt fails when reversing an array
This commit is contained in:
Zheng-Ning Liu 2021-04-30 13:46:10 +08:00 committed by GitHub
commit 989f09ba97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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";
}