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

Converter unsupported ops, requesting support: BitwiseOr, LeftShift, _SwitchN, RightShift, BitwiseXor #8170

Open
kjabon opened this issue Feb 5, 2024 · 2 comments

Comments

@kjabon
Copy link

kjabon commented Feb 5, 2024

Please make sure that this is a feature request. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:feature_template

System information

  • TensorFlow.js version (you are using):
    4.17.0
  • Are you willing to contribute it (Yes/No):
    Yes, if guidance provided.

Describe the feature and the current behavior/state.
Current behavior: tf->tfjs converter does not support these ops: BitwiseOr, LeftShift, _SwitchN, RightShift, BitwiseXor.
Feature: support these ops in the converter.

Will this change the current api? How?
No.

Who will benefit with this feature?
Everyone who uses these ops.

Any Other info.
Thank you and have a nice day.

@kjabon kjabon added the type:feature New feature or request label Feb 5, 2024
@kjabon kjabon changed the title Unsupported ops, requesting support: BitwiseOr, LeftShift, _SwitchN, RightShift, BitwiseXor Converter unsupported ops, requesting support: BitwiseOr, LeftShift, _SwitchN, RightShift, BitwiseXor Feb 5, 2024
@gaikwadrahul8 gaikwadrahul8 self-assigned this Feb 7, 2024
@gaikwadrahul8
Copy link
Contributor

gaikwadrahul8 commented Feb 7, 2024

Hi, @kjabon

Thank you for suggesting the addition of converter unsupported ops BitwiseOr, LeftShift, _SwitchN, RightShift, BitwiseXor to TensorFlow.js! We appreciate your feedback and interest in expanding the library's capabilities.

While we recognize the potential benefits of this feature, it's important to note that it's already available within the core TensorFlow codebase. You can access it using Python or other supported languages within that environment but I haven't found _SwitchN Op so May I know the benefits of that Op and use case where we can use that Op ?

  1. tf.bitwise.bitwise_or()
  2. tf.bitwise.bitwise_xor()
  3. tf.bitwise.left_shift()
  4. tf.bitwise.right_shift()

We understand that having this functionality directly in TensorFlow.js would be convenient for browser-based or JavaScript-focused projects. However, implementing it in TensorFlow.js involves technical considerations and alignment with our current development priorities.

If someone or you're interested in seeing this feature implemented directly in TensorFlow.js, we welcome contributions from you and the community please refer How to Contribute and How to Contribute a New op to TF.js Repository

Thank you for your cooperation and patience.

@kjabon
Copy link
Author

kjabon commented Feb 9, 2024

Thank you, looking into workarounds, will possibly look into contrib if fail.

_SwitchN: (from here)

The "tf_executor._SwitchN" operation takes two inputs, data and index and an integer attribute num_outs indicating the number of outputs. The data input is copied to output indicated by the index input. The other outputs are marked as dead. If one of the inputs or a control token is dead, then all of the outputs are marked as dead as well.

So, I'm aware of the python codebase, but thanks for outlining the full picture for context.
It would be ideal to run tensorflow on the web, to offload scaling server costs that would come with hosting services. I expect this is a large part of why tfjs exists to begin with. I would imagine the team working on tfjs would consider being able to claim feature parity with python tensorflow a priority. Perhaps there is some case to be made for integration with firebase services or similar if the political will / business story isn't obvious, similar to what's being done for mobile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants