Skip to content

Commit

Permalink
Fix string comparison (#1014)
Browse files Browse the repository at this point in the history
Fix string comparison in validate_initializer_name

Signed-off-by: Chin Huang <chhuang@us.ibm.com>
  • Loading branch information
chinhuang007 authored Mar 17, 2022
1 parent f6bebcc commit e2a8a71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions onnx_tf/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ def tensor2list(onnx_tensor):
return numpy_helper.to_array(onnx_tensor).flatten().tolist()

def validate_initializer_name(name):
# Prepend a unique suffix if leading charater is "_"
name = get_unique_suffix() + name if name[0] is "_" else name
# Prepend a unique suffix if leading character is "_"
name = get_unique_suffix() + name if name[0] == "_" else name

# Replace ":" with "_tf_" and append a unique suffix for
# traceability
Expand Down

0 comments on commit e2a8a71

Please sign in to comment.