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

Add tensor.m(mask) operator #791

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jerry73204
Copy link
Contributor

This patch adds a tensor.m(mask) operator. The mask can be a tensor or a boolean slice/array.
It depends on a previous PR #790 that is still under review.

let x: Tensor = vec![1i64, 2, 3, 4].try_into().unwrap();
let y = x.m([true, false, false, true]);  // [1, 4]

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.

None yet

1 participant