From d625648626259a317f5f018748b1cd54f3c09a09 Mon Sep 17 00:00:00 2001 From: Chen Xi Date: Thu, 8 Sep 2022 09:08:40 +0800 Subject: [PATCH] fix the scalar shape check (#1223) --- neural_compressor/adaptor/tf_utils/graph_converter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neural_compressor/adaptor/tf_utils/graph_converter.py b/neural_compressor/adaptor/tf_utils/graph_converter.py index 4519447bbdc..72b0af00fd3 100644 --- a/neural_compressor/adaptor/tf_utils/graph_converter.py +++ b/neural_compressor/adaptor/tf_utils/graph_converter.py @@ -197,6 +197,9 @@ def _inference(self, model): # sometimes the input_tensor is not the same order with inputs # we should check and pair them def check_shape(tensor, data): + # scalar default True + if tensor.shape == None: + return True tensor_shape = tuple(tensor.shape) data_shape = tuple(data.shape) for tensor_dim, data_dim in zip(tensor_shape, data_shape):