Repository navigation
Conversation
Preserve C-contiguous semantics while exposing non-overlapping dense layouts for any axis order. Add C++ and Python documentation and regression coverage for stride and layout edge cases.
|
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
Record the new C++ and Python dense-layout queries under Main.
Author
|
All GitHub Actions workflows for this PR currently show |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type
Motivation and Context
Tensor::IsContiguous()intentionally means C-contiguous, so a tensor with a different axis order can still occupy one gap-free, non-overlapping memory span while returningfalse. This adds a separate query for that layout without changing existingIsContiguous()behavior.Checklist
python util/check_style.py --applyto apply Open3D code style.Description
Adds
Tensor::IsDense()andTensor.is_dense()to report non-overlapping tensors whose elements cover one contiguous span in any dimension order. Singleton strides are ignored; empty tensors and scalars are dense. Negative strides are checked by magnitude, with documentation warning that density alone does not make a forwardmemcpysafe. Spans outside Open3D's signedint64_telement/offset range are rejected.Verification
Passed locally:
Tensor.h, including the issue layout, negative strides, empty/scalar, holes, overlap, and overflow cases.cpp/tests/core/Tensor.cppwith the generated Open3D compile flags.python/test/core/test_core.py.git diff --check.The repository
testsexecutable and Python runtime test were not run locally. The combined C++ test target begins by building Open3D's full VTK dependency chain, and the local build was stopped before reaching the test binary. Please use CI to validate the complete test matrix.