Skip to main content
Tensor shape validation is the final gate before a merge can proceed. This page specifies the algorithm that iterates over state_dict entries, compares shapes and dtypes, and reports the first fatal mismatch.

Validation Algorithm

Dtype Compatibility Rules

Broadcasting Rules

When shapes do not match exactly, the TensorEngine applies broadcasting rules defined in Tensor Math. Broadcasting is only permitted when the shapes are compatible per elementwise rules: dimensions must be equal or one of them must be 1. Broadcasting across parameter keys (e.g., different layer counts) is not supported and produces INCOMPATIBLE.

Mismatch Report Format

The first mismatch terminates validation and produces a structured report: