forked from jiuyuan/InfiniTensor
修正Slice内存越界问题 (#204)
fix (slice): add guard for area out of range Co-authored-by: Haojie Wang <haojie0429@gmail.com>
This commit is contained in:
parent
b15c4979fa
commit
46e61a5bd4
|
@ -35,7 +35,7 @@ __global__ void _pad_slice_kernel(T *part, T *whole, TransMetaData metaData,
|
|||
whole[tid] = 0;
|
||||
else
|
||||
whole[tid] = part[offset];
|
||||
else
|
||||
else if (offset >= 0)
|
||||
part[offset] = whole[tid];
|
||||
tid += stride;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue