From 3e15658f9df244fba1d7ae91cdc746193affd877 Mon Sep 17 00:00:00 2001 From: pinto0309 Date: Tue, 7 Jun 2022 20:30:18 +0900 Subject: [PATCH] string attributes bug fixes --- sog4onnx/__init__.py | 2 +- sog4onnx/onnx_operation_generator.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sog4onnx/__init__.py b/sog4onnx/__init__.py index 6b95c9b..6c79ab7 100644 --- a/sog4onnx/__init__.py +++ b/sog4onnx/__init__.py @@ -1,3 +1,3 @@ from sog4onnx.onnx_operation_generator import generate, main -__version__ = '1.0.11' +__version__ = '1.0.12' diff --git a/sog4onnx/onnx_operation_generator.py b/sog4onnx/onnx_operation_generator.py index 281898e..9b1a1d8 100644 --- a/sog4onnx/onnx_operation_generator.py +++ b/sog4onnx/onnx_operation_generator.py @@ -360,7 +360,12 @@ def main(): # parse attr_name = attribute[0] attr_type = attribute[1] - attr_value = ast.literal_eval(attribute[2]) + if attr_type == 'string': + attr_type = 'str' + if attr_type != 'str': + attr_value = ast.literal_eval(attribute[2]) + else: + attr_value = attribute[2] # dtype check if attr_type not in AVAILABLE_DTYPES: