Skip to content
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

Avoid dtype comparison failure in take -- upcast indices in take_strict_sorted #464

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

joseph-isaacs
Copy link
Member

Upcast the indices in take_strict_sorted but first trying to upcast the scalar value, then the indices themselves.

Note. this is likely to be superseded by array.filter(bool) -> array.

&Scalar::from(chunk_begin).cast(chunk_indices.dtype())?,
)?
} else {
// TODO: this is unnecessary, could instead upcast in the subtract.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it's better to assert on it here, b/c you can do subtract_scalar with negative value. let's remove the TODO?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will update comment

Comment on lines +107 to +109
PType::F16 => panic!("Unsupported ptype f16"),
PType::F32 => panic!("Unsupported ptype f32"),
PType::F64 => panic!("Unsupported ptype f64"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to remove any string concat at compile time

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(So max_value can be a const fn since format! isn't const)

@joseph-isaacs joseph-isaacs merged commit c9b4f61 into develop Jul 17, 2024
2 checks passed
@joseph-isaacs joseph-isaacs deleted the take_strict_sorted-upcast branch July 17, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants