You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create is_unknown and has_unknown_dim on Shape (#201)
This PR enables usages described in
#199.
This pull request enhances the handling and documentation of unknown
dimensions in the `Shape` class within the ONNX IR core. It introduces
new methods to check for unknown dimensions, updates the documentation
to clarify shape equality with unknowns, and adds comprehensive tests to
ensure correct behavior. Additionally, it clarifies the serialization
logic for symbolic dimensions with unknown values.
**Shape API improvements:**
* Added `is_unknown(dim)` and `has_unknown_dim()` methods to the `Shape`
class to check for unknown (i.e., `None`) dimensions, and updated the
class docstring to clarify shape equality semantics when unknowns are
present.
**Serialization:**
* Clarified that a symbolic dimension with `None` value is valid and
should result in an empty field in the serialized proto, reflecting ONNX
semantics for unknown dimensions.
---------
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
0 commit comments