mirror of https://github.com/Jittor/Jittor
optimize getitem
This commit is contained in:
parent
989f09ba97
commit
1e65e183bb
|
@ -8,7 +8,7 @@
|
||||||
# This file is subject to the terms and conditions defined in
|
# This file is subject to the terms and conditions defined in
|
||||||
# file 'LICENSE.txt', which is part of this source code package.
|
# file 'LICENSE.txt', which is part of this source code package.
|
||||||
# ***************************************************************
|
# ***************************************************************
|
||||||
__version__ = '1.2.2.63'
|
__version__ = '1.2.2.64'
|
||||||
from . import lock
|
from . import lock
|
||||||
with lock.lock_scope():
|
with lock.lock_scope():
|
||||||
ori_int = int
|
ori_int = int
|
||||||
|
|
|
@ -462,6 +462,9 @@ void GetitemOp::jit_run() {
|
||||||
auto in = inputs().front();
|
auto in = inputs().front();
|
||||||
auto out = outputs().front();
|
auto out = outputs().front();
|
||||||
if (out->num == 0) return;
|
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];)
|
@for(i, 0, ODIM, index_t oshape@i = o_shape[@i];)
|
||||||
@if(ODIM>0,
|
@if(ODIM>0,
|
||||||
|
|
Loading…
Reference in New Issue