请教zeros接口的使用问题?
Created by: yeyupiaoling
环境
- PaddlePaddle 1.3
- Ubuntu 16.04
- Python 3.5
问题
我想用PaddlePaddle复写下面tensorflow的代码:
zeros = tf.zeros_like(label)
我写的PaddlePaddle代码:
zeros = fluid.layers.zeros(shape=label.shape, dtype=label.dtype)
报错如下:
paddle.fluid.core.EnforceNotMet: Invoke operator fill_constant error.
C++ Callstacks:
Enforce failed. Expected numel() >= 0, but received numel():-1 < 0:0.
When calling this method, the Tensor's numel must be equal or larger than zero. Please check Tensor::Resize has been called first. at [/paddle/paddle/fluid/framework/tensor.cc:44]
PaddlePaddle Call Stacks: