Fix appending empty tensor point clouds - #7533
Open
tianrking wants to merge 1 commit into
Open
Conversation
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
A default-constructed tensor
PointCloudhas no declared attributes. Callingappend()currently reads its missingpositionsentry before there is a dtypeor shape to validate, so the common incremental-accumulation pattern fails. The
opposite operand order fails as well because the populated cloud expects the
schema-less cloud to provide every attribute.
Checklist:
python util/check_style.py --applyto apply Open3D code styleto my code.
updated accordingly.
results (e.g. screenshots or numbers) here.
Description
Treat only a point cloud with no declared attributes as the identity for
append()/operator+:schema, dtype, and device.
device.
a schema.
The C++ and Python regression coverage exercises both operand orders, schema and
device preservation, the both-empty case, and non-aliasing. The schema-less
operand deliberately uses its default CPU device so accelerator CI also guards
cross-device adoption.
Validation:
open3d==0.19.0: schema-less +populated raises an
IndexError; populated + schema-less raises the missingpositionsRuntimeError; schema-less + schema-less raises anIndexError.cmake --build <build-dir> --target tests -- -j1(136/136 build steps)tests.exe --gtest_filter=PointCloud/PointCloudPermuteDevices.Append/*(1 test passed on CPU)
clang-format --dry-run --Werroron all four changed C++/header filespy_compilefor the changed Python testpytest --collect-onlyforpython/test/t/geometry/test_pointcloud.py(11 tests collected)
git diff --checkThe Python behavior assertions were not executed locally because the Python
binding was not rebuilt; they are included for the project's wheel CI alongside
the directly executed C++ regression.