From ee5cb5f2fefdbf9b10222f35a5f44f8481d4a1e0 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Sun, 10 Jul 2022 22:13:24 -0500 Subject: [PATCH] fix undefined-variable (#44187) --- python/paddle/hapi/model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/hapi/model.py b/python/paddle/hapi/model.py index 31a430789d..16b3646a4a 100644 --- a/python/paddle/hapi/model.py +++ b/python/paddle/hapi/model.py @@ -465,7 +465,7 @@ class StaticGraphAdapter(object): idx] == core.VarDesc.VarType.FP16: if isinstance(feed[n], core.LoDTensor): feed[n] = feed[n]._as_type(core.VarDesc.VarType.FP16) - elif isinstance(feed[n], numpy.array): + elif isinstance(feed[n], np.array): feed[n] = feed[n].astype('float16') if labels is not None: -- GitLab