numpy array multiply tensor
Created by: achao2013
i have a numpy array "mask" , a tensor involve gradient back propagation. their shape is the same. i want to know how to multiply them. my code is as follows: cost = fluid.layers.reduce_mean(fluid.layers.abs(label - out)*mask) it's ok in tensorflow, but it fails in paddle:
File "/home/work/.jumbo/lib/python2.7/site-packages/paddle/fluid/layers/math_op_patch.py", line 123, in impl self.block, value=other_var, dtype=lhs_dtype) File "/home/work/.jumbo/lib/python2.7/site-packages/paddle/fluid/layers/math_op_patch.py", line 51, in create_scalar return create_tensor(block, value, dtype, shape=[1]) File "/home/work/.jumbo/lib/python2.7/site-packages/paddle/fluid/layers/math_op_patch.py", line 34, in create_tensor value = float(value) TypeError: only size-1 arrays can be converted to Python scalars