用create_lod_tensor创建一个lod_tensor,输入的data是numpy的array,执行len(tensor.shape)报错
Created by: xieqingxing
代码: label_weight = np.array([[1,0,0,0,0,0,0,0,0], [0,30,0,0,0,0,0,0,0], [0,0,30,0,0,0,0,0,0], [0,0,0,30,0,0,0,0,0], [0,0,0,0,30,0,0,0,0], [0,0,0,0,0,30,0,0,0], [0,0,0,0,0,0,30,0,0], [0,0,0,0,0,0,0,30,0], [0,0,0,0,0,0,0,0,30]])
lod_weight = fluid.create_lod_tensor(data=label_weight,recursive_seq_lens=[[9]],place=fluid.CUDAPlace(0))