Skip to content

Commit 81fdc28

Browse files
authored
fix fp16 initializer dtype check test=develop (#15669) (#15682)
1 parent ace33d7 commit 81fdc28

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/paddle/fluid/layer_helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ def create_parameter(self,
302302
if default_initializer is None and attr.initializer is None:
303303
if isinstance(dtype, core.VarDesc.VarType):
304304
if dtype != core.VarDesc.VarType.FP32 and \
305-
dtype != core.VarDesc.VarType.FP64:
305+
dtype != core.VarDesc.VarType.FP64 and \
306+
dtype != core.VarDesc.VarType.FP16:
306307
raise TypeError(
307308
"Can not create parameter with default initializer when dtype is not float type. Set default_initializer to fit the parameter dtype!"
308309
)

0 commit comments

Comments
 (0)