Created by: liym27
API fluid.data/fluid.layers.data 报错信息增强 [仅涉及Python端]
paddle.fluid.data(name, shape, dtype='float32', lod_level=0)
paddle.fluid.layers.data(name, shape, append_batch_size=True, dtype='float32', lod_level=0, type=VarType.LOD_TENSOR, stop_gradient=True)
因为这2个接口的单测在同一文件,且通用之处较多,所以在同一个PR中修改。
name
的类型是str/unicode
1. 参数- 报错样例:
TypeError: The type of 'name' in data must be (<type 'str'>, <type 'unicode'>), but received <type 'int'>.
shape
的类型是list/tuple
2. 参数- 报错样例:
TypeError: The type of 'shape' in data must be (<type 'list'>, <type 'tuple'>), but received <type 'int'>.