-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct bound check for axis aligned bounding box and use same formatting for printing cuda or cpu tensor #6444
Correct bound check for axis aligned bounding box and use same formatting for printing cuda or cpu tensor #6444
Conversation
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
9381e53
to
bfa6f46
Compare
bfa6f46
to
0afb67e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 4 files reviewed, all discussions resolved
* Change invalid values of min_bound and max_bound as done in legacy, related pr #6444 * Correct points length check when creating AABB from points. * Print min and max bound of AABB when printing AABB * Add brief docs for methods and variables, fix warning messages. * Fix AABB ToString() test --------- Co-authored-by: Sameer Sheorey <41028320+ssheorey@users.noreply.github.com>
@@ -750,7 +750,7 @@ std::string Tensor::ToString(bool with_suffix, | |||
std::ostringstream rc; | |||
if (IsCUDA() || !IsContiguous()) { | |||
Tensor host_contiguous_tensor = Contiguous().To(Device("CPU:0")); | |||
rc << host_contiguous_tensor.ToString(false, ""); | |||
rc << host_contiguous_tensor.ToString(with_suffix, indent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I added a regression here. with_suffix
should be set to false, else it will print suffix twice. once in inner call where tensor is moved to CPU and once in outer call.
Example -
o3d.core.Tensor.eye(n=4, dtype=o3d.core.Dtype.Float64, device=o3d.core.Device('cuda:0'))
[[1 0 0 0],
[0 1 0 0],
[0 0 1 0],
[0 0 0 1]]
Tensor[shape={4, 4}, stride={4, 1}, Float64, CPU:0, 0x561c38e195d0]
Tensor[shape={4, 4}, stride={4, 1}, Float64, CUDA:0, 0x302000000]
I will address this in my next PR.
Type
Motivation and Context
A. Cuda tensor do not use same formatting as tensor in cpu.
B. Axis aligned Bounding Box can be constructed with invalid bounds and causes aberrant behaviour.
Checklist:
python util/check_style.py --apply
to apply Open3D code styleto my code.
updated accordingly.
results (e.g. screenshots or numbers) here.
Description
Printing cuda tensor with same formatting variables
with_suffix
andindent
as passed in calling method is self-explanatory.For #6436, In case min bound is larger than amx bound in at least one axis, the min bound and max bound values are swapped in those axis/axes with a warning, reporting user of the change made.
This change is