yongster opened a new pull request, #11249: URL: https://github.com/apache/arrow-rs/pull/11249
# Which issue does this PR close? - Closes #11248. # Rationale for this change `FixedShapeTensor` stores a physical shape and an optional permutation, but does not expose the logical shape. The extension defines logical dimension `i` as physical dimension `permutations[i]`. Physical shape `[100, 200, 500]` with permutation `[2, 0, 1]` is logical shape `[500, 100, 200]`. This is independent of #11247, which exposes the physical shape. The two accessors answer different questions. # What changes are included in this PR? - `FixedShapeTensor::logical_shape(&self) -> Vec<usize>` - `FixedShapeTensorMetadata::logical_shape(&self) -> Vec<usize>` - Without a permutation, the result is the physical shape - A doc example for `[100, 200, 500]` / `[2, 0, 1]`, plus tests for no permutation, that permutation, and an identity permutation Serialization and validation are unchanged. This does not rename the metadata key `permutations`. # Are these changes tested? Yes. - `cargo test -p arrow-schema --features canonical_extension_types --lib logical_shape` - `cargo test -p arrow-schema --doc --features canonical_extension_types logical_shape` - `cargo clippy -p arrow-schema --features canonical_extension_types --all-targets --no-deps -- -D warnings` # Are there any user-facing changes? Additive API only, behind the existing `canonical_extension_types` feature. No breaking change. AI assistance: the accessor and tests were drafted with AI and checked against the permutation rule already documented on `FixedShapeTensor`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
