cppflow icon indicating copy to clipboard operation
cppflow copied to clipboard

Multi output ops in raw_ops

Open ielenik opened this issue 4 years ago • 5 comments

Is there a reason why top_k op is not implemented? I have tried to add it by myself, but there is access violation deep inside tf lib So may be it is not supported by c api? https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/top-k

PS Looks like it should be TopKV2 PPS It works with TopKV2, I am not sure I shoud add it via pull request

ielenik avatar May 13 '21 09:05 ielenik

Hi @ielenik ,

It is not included because the generator.py file is a simple script that ignores multioutput operations at the moment. It would be great to include it in a close future.

It's great that you solved your problem. How did you implement the operation? By directly modifying raw_ops.h or by modifying the generator.py script?

serizba avatar May 13 '21 16:05 serizba

I was not aware about generator.py. Well, I have modified it now to add support for mutliple return. And now it is works (at least for top_k_v2) There was few issues about max min defines and 'switch' function, I a not sure I resolve it correctly The call looks like auto [val, top] = cppflow::top_k_v2(dist, tens_numg);

But I just have read about pull requests on github since I never did it before. Looks like to modify one single file the whole project should be forked? Is there any sipmlier way?

If not I will try to do it later, for now there is a link to file in the cloud https://cloud.mail.ru/public/LK6X/Zv4kZ1Udb

ielenik avatar May 14 '21 09:05 ielenik

If you don't want to fork the project in github, you can try git format-patch on your local git repo, and then attach the patch set in this issue.

On Fri, May 14, 2021, 05:54 ielenik @.***> wrote:

I was not aware about generator.py. Well, I have modified it now to add support for mutliple return. And now it is works (at least for top_k_v2) There was few issues about max min defines and 'switch' function, I a not sure I resolve it correctly The call looks like auto [val, top] = cppflow::top_k_v2(dist, tens_numg);

But I just have read about pull requests on github since I never did it before. Looks like to modify one single file the whole project should be forked? Is there any sipmlier way?

If not I will try to do it later, for now there is a link to file in the cloud https://cloud.mail.ru/public/LK6X/Zv4kZ1Udb

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/serizba/cppflow/issues/120#issuecomment-841141655, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALDTHQOTMJZBQAFLK6B7BLTNTXOBANCNFSM442IIVPQ .

ljn917 avatar May 14 '21 10:05 ljn917

Ok. I hope what made it correctly

0001-adding-multireturn-support-for-tensorflow-ops_genera.zip

ielenik avatar May 14 '21 10:05 ielenik

Thanks @ielenik !

Looks like a good work. I will take a look to it and try to add it to the repo as soon as I have time.

Thanks

serizba avatar May 26 '21 11:05 serizba