[go: nahoru, domu]

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

[ method should accept logical vectors / bool tensors #521

Open
t-kalinowski opened this issue Mar 15, 2022 · 2 comments
Open

[ method should accept logical vectors / bool tensors #521

t-kalinowski opened this issue Mar 15, 2022 · 2 comments

Comments

@t-kalinowski
Copy link
Member

dispatch to tf.boolean_mask

@mohamed-180
Copy link

Does this will help :

if (is_tensor(dots[[1]]))
  if (dots[[1]]$dtype$is_bool) 
    tf$boolean_mask(x,dots[[1]])
   
  # ToDo make slice with tensors one based    
x <- tf$constant(1:6)
y <- tf$constant(c(T,T,T,F,F,T))
x[y]

tf.Tensor([1 2 3 6], shape=(4), dtype=int32)

@t-kalinowski
Copy link
Member Author
t-kalinowski commented Mar 15, 2022

Something like that would work I think. We'll also need it to work well for nd-arrays (not just 1d), nice error messages if a user tries to mix-n-match subsetting styles, and have a full test suite to go along with it.

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

No branches or pull requests

2 participants