对tensor进行切片,当输入为超长shape的tensor时,输出被截断
Created by: LutaoChu
反馈一个bug y=x[1:] 如果x的维度大于9999999,y的长度最多只有9999999
复现代码
import paddle
import paddle.fluid as fluid
import numpy as np
fluid.default_startup_program().random_seed = 1000
fluid.default_main_program().random_seed = 1000
import random
random.seed(0)
np.random.seed(0)
data = np.random.random((20000000)).astype(np.float32)
x = fluid.layers.data(name="x", shape=[20000000], dtype='float64')
y = x[1:]
place = fluid.CUDAPlace(0)
exe = fluid.Executor(place)
exe.run(fluid.default_startup_program())
outs = exe.run(feed={'x':data},
fetch_list=[y.name])
print(outs[0].shape)