From 81fdc286daf89c95a32e1fa668169890d317c523 Mon Sep 17 00:00:00 2001 From: Wu Yi Date: Wed, 13 Feb 2019 18:40:17 +0800 Subject: [PATCH] fix fp16 initializer dtype check test=develop (#15669) (#15682) --- python/paddle/fluid/layer_helper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/layer_helper.py b/python/paddle/fluid/layer_helper.py index a172141b3..7d1636774 100644 --- a/python/paddle/fluid/layer_helper.py +++ b/python/paddle/fluid/layer_helper.py @@ -302,7 +302,8 @@ class LayerHelper(object): if default_initializer is None and attr.initializer is None: if isinstance(dtype, core.VarDesc.VarType): if dtype != core.VarDesc.VarType.FP32 and \ - dtype != core.VarDesc.VarType.FP64: + dtype != core.VarDesc.VarType.FP64 and \ + dtype != core.VarDesc.VarType.FP16: raise TypeError( "Can not create parameter with default initializer when dtype is not float type. Set default_initializer to fit the parameter dtype!" ) -- GitLab