From c670ccf85ea1b714b6203ef32abad62cdcb92dc6 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Wed, 10 Nov 2021 02:55:10 -0500 Subject: [PATCH] fix SyntaxWarning in graph.py /home/runner/work/deepmd-kit/deepmd-kit/deepmd/utils/graph.py:156: SyntaxWarning: "is not" with a literal. Did you mean "!="? --- deepmd/utils/graph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepmd/utils/graph.py b/deepmd/utils/graph.py index 031454e4b9..e6ff47b21f 100644 --- a/deepmd/utils/graph.py +++ b/deepmd/utils/graph.py @@ -153,7 +153,7 @@ def get_embedding_net_nodes_from_graph_def(graph_def: tf.GraphDef, suffix: str = The embedding net nodes within the given tf.GraphDef object """ # embedding_net_pattern = f"filter_type_\d+{suffix}/matrix_\d+_\d+|filter_type_\d+{suffix}/bias_\d+_\d+|filter_type_\d+{suffix}/idt_\d+_\d+|filter_type_all{suffix}/matrix_\d+_\d+|filter_type_all{suffix}/matrix_\d+_\d+_\d+|filter_type_all{suffix}/bias_\d+_\d+|filter_type_all{suffix}/bias_\d+_\d+_\d+|filter_type_all{suffix}/idt_\d+_\d+" - if suffix is not "": + if suffix != "": embedding_net_pattern = EMBEDDING_NET_PATTERN\ .replace('/idt', suffix + '/idt')\ .replace('/bias', suffix + '/bias')\