Context
During GraphProperties conversion in mark_for_compilation_pass.cc, a dimension without expression metadata is converted to a constant expression using its TensorFlow dimension size. For an unknown dimension, that produces both:
- TensorFlow dimension size
-1
- symbolic expression
Const(-1)
TensorFlow normally uses dimension size -1 as an unknown-shape sentinel. In the symbolic expression system, however, Const(-1) may be treated as a known constant value rather than an unknown dimension.
The same conversion also represents an unknown rank using the synthetic variables Var(-888) and Var(-889), which effectively assumes two symbolic dimensions even though the actual rank is unknown.
Risk
Changing this directly may affect clustering, symbolic propagation, and compatibility checks that currently rely on these fallbacks. This should therefore be investigated with focused regression tests before changing the representation.
Possible direction
- Preserve TensorFlow dimension size
-1 for unknown dimensions.
- Use an explicit unknown expression, or no expression metadata, instead of
Const(-1).
- Represent unknown rank explicitly rather than inventing a fixed number of symbolic dimensions.
- Check all consumers for assumptions about missing or unknown expression metadata.
This is a deferred robustness investigation; it is not currently tied to a confirmed model failure.
Context
During GraphProperties conversion in
mark_for_compilation_pass.cc, a dimension without expression metadata is converted to a constant expression using its TensorFlow dimension size. For an unknown dimension, that produces both:-1Const(-1)TensorFlow normally uses dimension size
-1as an unknown-shape sentinel. In the symbolic expression system, however,Const(-1)may be treated as a known constant value rather than an unknown dimension.The same conversion also represents an unknown rank using the synthetic variables
Var(-888)andVar(-889), which effectively assumes two symbolic dimensions even though the actual rank is unknown.Risk
Changing this directly may affect clustering, symbolic propagation, and compatibility checks that currently rely on these fallbacks. This should therefore be investigated with focused regression tests before changing the representation.
Possible direction
-1for unknown dimensions.Const(-1).This is a deferred robustness investigation; it is not currently tied to a confirmed model failure.