optimize getitem

This commit is contained in:
Dun Liang 2021-04-30 19:22:39 +08:00
parent 989f09ba97
commit 1e65e183bb
2 changed files with 4 additions and 1 deletions

View File

@ -8,7 +8,7 @@
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
# ***************************************************************
__version__ = '1.2.2.63'
__version__ = '1.2.2.64'
from . import lock
with lock.lock_scope():
ori_int = int

View File

@ -462,6 +462,9 @@ void GetitemOp::jit_run() {
auto in = inputs().front();
auto out = outputs().front();
if (out->num == 0) return;
if (in->allocator == out->allocator &&
in->allocation == out->allocation)
return;
@for(i, 0, ODIM, index_t oshape@i = o_shape[@i];)
@if(ODIM>0,