[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

Feature Request: Support for ragged argmin/argmax #43460

Open
atyshka opened this issue Sep 22, 2020 · 2 comments
Open

Feature Request: Support for ragged argmin/argmax #43460

atyshka opened this issue Sep 22, 2020 · 2 comments
Assignees
Labels
comp:ops OPs related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower type:feature Feature requests

Comments

@atyshka
Copy link
atyshka commented Sep 22, 2020

System information

  • TensorFlow version: 2.3.0
  • Are you willing to contribute it: Possibly

Describe the feature and the current behavior/state.
tf.math.argmax/argmin does not support ragged tensors.
Will this change the current api? How?
No breaking changes, simply additive in nature.
Who will benefit with this feature?
In my opinion this is particularly important, as it can condense a ragged dimension down to a 1-dimension. In my use case, I have predictions that can be of variable length. I want to take the minimum, which would effectively eliminate the ragged dimension.
Any Other info.
For anyone else looking for a workaround, currently my approach is to convert the ragged tensor to a regular tensor. The default value should be max positive number if you are performing min or max negative number if you are performing max.

@atyshka atyshka added the type:feature Feature requests label Sep 22, 2020
@amahendrakar amahendrakar added the comp:ops OPs related issues label Sep 22, 2020
@aavishkarmishra
Copy link
Contributor

Interested !!

@jvishnuvardhan jvishnuvardhan added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Oct 30, 2020
@raghakot
Copy link
raghakot commented Feb 1, 2021

Here is a simple workaround.

indices = tf.map_fn(tf.math.argmax, ragged_tensor, fn_output_signature=tf.int64)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:ops OPs related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower type:feature Feature requests
Projects
None yet
Development

No branches or pull requests

5 participants