From c0f9e3f7b84112a36d9e76e9876be7be8d4a71f7 Mon Sep 17 00:00:00 2001 From: barrierye Date: Fri, 19 Jun 2020 21:07:17 +0800 Subject: [PATCH] fix client --- python/paddle_serving_client/__init__.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/python/paddle_serving_client/__init__.py b/python/paddle_serving_client/__init__.py index 24945d0d..864dc39c 100644 --- a/python/paddle_serving_client/__init__.py +++ b/python/paddle_serving_client/__init__.py @@ -484,12 +484,15 @@ class MultiLangClient(object): raise Exception("error tensor value type.") elif isinstance(var, np.ndarray): data = var - if v_type == 0 and data.dtype != 'int64': - data = data.astype("int64") - elif v_type == 1 and data.dtype != 'float32': - data = data.astype("float32") - elif v_type == 2 and data.dtype != 'int32': - data = data.astype("int32") + if v_type == 0: + if data.dtype != 'int64': + data = data.astype("int64") + elif v_type == 1: + if data.dtype != 'float32': + data = data.astype("float32") + elif v_type == 2: + if data.dtype != 'int32': + data = data.astype("int32") else: raise Exception("error tensor value type.") else: -- GitLab