-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Open
Labels
bugNot a build issue, this is likely a bug.Not a build issue, this is likely a bug.
Description
Checklist
- I have searched for similar issues.
- For Python issues, I have tested with the latest development wheel.
- I have checked the release documentation and the latest documentation (for
main
branch).
Describe the issue
Slices of boolean mask tensors are not converted to indices correctly when using advanced indexing.
See PR #7340
Steps to reproduce the bug
Tensor a = Tensor::Zeros({20}, core::Int64, Device("CUDA:0"));
a.SetItem(core::TensorKey::Slice(0, 5, 1), Tensor::Init<int64_t>(1, a.GetDevice()));
a.SetItem(core::TensorKey::Slice(10, 15, 1), Tensor::Init<int64_t>(1, a.GetDevice()));
Tensor mask = a.Gt(0);
Tensor subRangeofMask = mask.Slice(0, 10, 20);
Tensor maskedFullRange = a.IndexGet({mask});
Tensor maskedSubRange = a.Slice(0, 10, 20).IndexGet({subRangeOfMask});
EXPECT_EQ(maskedFullRange.Slice(0, 10, 20), maskedSubRange); // this fails!
Error message
No response
Expected behavior
The boolean mask should be converted to the index list by using the correct data pointer (offset by potential slicing)
Open3D, Python and System information
- Operating system: Ubuntu 24.04
- Python version: Python 3.8
- Open3D version: latest main (fb7088ceebef38d54c575b47935e568979b50954)
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: build from source
- Compiler version (if built from source): gcc 13.3
Additional information
No response
Metadata
Metadata
Assignees
Labels
bugNot a build issue, this is likely a bug.Not a build issue, this is likely a bug.