Summary
When a tensor parameter's incoming value has ⊤ shape (an unresolved-allocator-shape ReturnValueKey source, which the analysis self-labels a "Candidate for a #370 shape annotation"), a consumer operator inside the function frequently fixes the parameter's rank statically. Recovering the rank alone would turn a fully-⊤ shape into a rank-known, extents-⊤ shape, which is a materially stronger result: it pins rank plus dtype while leaving only the still-unresolved extents unknown. Note the "#370 candidate" tag does not by itself imply the shape is inherently content-dependent; it only records that the shape was not resolved, which spans both genuinely-dynamic extents and statically-recoverable structure the analysis is currently missing (e.g. a fixed label-count trailing dimension).
Observed (NLPGNN, 0.52.31)
Transpose permutation length. nlpgnn/metrics/crf.py's crf_forward(inputs, state, ...) begins inputs = tf.transpose(inputs, [1, 0, 2]), so inputs is provably rank-3. Six crf.py parameters (the unary potentials and the recurrence state across crf_forward, crf_unary_score, crf_log_norm, crf_sequence_score, CrfLogLikelihood.call) infer a concrete float32 dtype but a fully-⊤ shape.
Einsum subscript. DenseLayer3dProj.call's tf.einsum("BFND,NDH->BFH", input_tensor, w) fixes input_tensor at rank-4 and shares the N/D labels with the statically-shaped w. Tracked as its own instance in #704.
Relationship To Existing Issues
Why It Matters
Rank plus dtype is what distinguishes a retracing-reducing shape from a fully-open one, so recovering rank on these content-dependent tensors is the highest-leverage precision step short of user annotations.
Summary
When a tensor parameter's incoming value has ⊤ shape (an unresolved-allocator-shape
ReturnValueKeysource, which the analysis self-labels a "Candidate for a #370 shape annotation"), a consumer operator inside the function frequently fixes the parameter's rank statically. Recovering the rank alone would turn a fully-⊤ shape into a rank-known, extents-⊤ shape, which is a materially stronger result: it pins rank plus dtype while leaving only the still-unresolved extents unknown. Note the "#370 candidate" tag does not by itself imply the shape is inherently content-dependent; it only records that the shape was not resolved, which spans both genuinely-dynamic extents and statically-recoverable structure the analysis is currently missing (e.g. a fixed label-count trailing dimension).Observed (NLPGNN, 0.52.31)
Transpose permutation length.
nlpgnn/metrics/crf.py'scrf_forward(inputs, state, ...)beginsinputs = tf.transpose(inputs, [1, 0, 2]), soinputsis provably rank-3. Sixcrf.pyparameters (the unary potentials and the recurrencestateacrosscrf_forward,crf_unary_score,crf_log_norm,crf_sequence_score,CrfLogLikelihood.call) infer a concretefloat32dtype but a fully-⊤ shape.Einsum subscript.
DenseLayer3dProj.call'stf.einsum("BFND,NDH->BFH", input_tensor, w)fixesinput_tensorat rank-4 and shares theN/Dlabels with the statically-shapedw. Tracked as its own instance in #704.Relationship To Existing Issues
DenseLayer3d.callinput tensor typed all-dynamic/unknown; static trailing (hidden) dimension not resolved #704 is the einsum instance of rank/label recovery, forDenseLayer3dProj.transpose(perm length ⇒ rank). The einsum generator already refines shared labels forward (Refine a shared einsum label's dynamic occurrence with a known one (wala/ML#704) ponder-lab/ML#558), so the question is whether an operator that consumes a ⊤-shaped parameter can likewise constrain that parameter's rank rather than leaving it fully ⊤.Why It Matters
Rank plus dtype is what distinguishes a retracing-reducing shape from a fully-open one, so recovering rank on these content-dependent tensors is the highest-leverage precision step short of user annotations.