更新后scatter调用出了问题
Created by: luameows
#12725 (closed) (原来issue已经关闭,不得已新开一个) 我安装了最新版本的whl包,调用scatter,还是有些问题。 其中label.shape=(-1,1),label_reshape.shape=(-1,)。features是我的网络输出层,shape=(-1,512)
label=fluid.layers.data(name='label',shape=[1],dtype='int64')
label_reshape=fluid.layers.reshape(x=label,shape=[-1],name='label_reshape')
centers_global=fluid.layers.scatter(input=centers_global,index=label_reshape,updates=diff)
test=fluid.layers.scatter(input=features,index=label_reshape,updates=features)
错误信息如下
--> 386 test=fluid.layers.scatter(input=features,index=label_reshape,updates=features)
/usr/local/lib/python2.7/dist-packages/paddle/fluid/layers/layer_function_generator.pyc in func(*args, **kwargs)
172 helper = LayerHelper(op_type, **kwargs)
173
--> 174 dtype = infer_and_check_dtype(op_proto, *args, **kwargs)
175
176 inputs = dict()
/usr/local/lib/python2.7/dist-packages/paddle/fluid/layers/layer_function_generator.pyc in infer_and_check_dtype(op_proto, *args, **kwargs)
152 val = [val]
153 if len(val) == 0:
--> 154 val = [args[0]]
155 args = args[1:]
156
IndexError: tuple index out of range