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 tf custom op conversion example #1878

Merged
merged 2 commits into from
Mar 14, 2022
Merged

Conversation

hwangdeyu
Copy link
Contributor

Add tf custom op conversion example

Signed-off-by: hwangdeyu [email protected]

Signed-off-by: hwangdeyu <[email protected]>
@hwangdeyu hwangdeyu requested a review from fatcat-z March 14, 2022 10:02
@lgtm-com
Copy link

lgtm-com bot commented Mar 14, 2022

This pull request introduces 1 alert when merging 561765d into 8f2e84b - view on LGTM.com

new alerts:

  • 1 for Module is imported with 'import' and 'import from'

@hwangdeyu hwangdeyu force-pushed the custom_op branch 3 times, most recently from 04cce83 to ffe7769 Compare March 14, 2022 12:04
Signed-off-by: hwangdeyu <[email protected]>
Co-authored-by: fatcat-z <[email protected]>
Copy link
Collaborator

@fatcat-z fatcat-z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@lgtm-com
Copy link

lgtm-com bot commented Mar 14, 2022

This pull request introduces 1 alert when merging 6c5523c into 8f2e84b - view on LGTM.com

new alerts:

  • 1 for Module is imported with 'import' and 'import from'

@hwangdeyu hwangdeyu enabled auto-merge (squash) March 14, 2022 12:26
@hwangdeyu hwangdeyu merged commit d536f04 into onnx:main Mar 14, 2022
x_ = AddOne.add_one(x)
_ = tf.identity(x_, name="output")

onnx_graph = tf2onnx.tfonnx.process_tf_graph(sess.graph,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use the OLD api !!!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will change a new example and use tf2 api

node.input.append(const_one)


with tf.compat.v1.Session() as sess:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use TF1 !!

*/

#include "tensorflow/core/framework/op.h"
#include "tensorflow/core/framework/shape_inference.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the purpose of this example.
A tf2onnx user will already have the tensorflow custom op, aka this code here he already has it.
Should the example not be AddOne in onnxruntime ?

@hwangdeyu hwangdeyu deleted the custom_op branch March 15, 2022 02:58
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.

3 participants