Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[onnx][importer] Sanitize '-' characters in TensorProto names (#3901)
Dense Resources cannot have `-` characters as part of the resource keys. Many ONNX models, however, do have these characters in `TensorProto` or initializer names. This patch adds an unconditional replace function in the sanitization of initializer names that replaces all `-` characters with `_` (underscores) when the dense resources are created, which allows successful parsing of the IR. In case the name was legal before sanitization, the function has no effect. Unnecessary additional time complexity is avoided by omitting an `if` condition to check containment.
- Loading branch information