-
Notifications
You must be signed in to change notification settings - Fork 74.2k
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 custom operator code generator script #6881
Add custom operator code generator script #6881
Conversation
This script uses jinja2 templates to generate the following: * C++ Header file that defines the operator class, templated on Device. * C++ Header file that defines the CPU implementation of the operator. * C++ Source file with Shape Function, REGISTER_OP and REGISTER_KERNEL_BUILDER constructs. * Cuda Header that defines the GPU implementation of the operator, including a CUDA kernel. * Cuda Source file with GPU REGISTER_KERNEL_BUILDER's for the operator. * python unit test case, which constructs random input data, and calls the operator. * Makefile for compiling the operator into a shared library, using g++ and nvcc. Operator inputs, outputs, polymorphic type attributes, other attributes and documentation can be specified.
Can one of the admins verify this patch? |
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I felt the content in the README.md was too large to be included in the Adding a New Op howto, but it may be appropriate to add a link to this tool in that file. |
I signed it! |
CLAs look good, thanks! |
Thanks! While it's nice, it'll take some effort to keep this in sync. I would suggest trying for contrib instead. |
Indeed, this is cool, but probably would be better as an external repo for now. GitHub doesn't provide great community tools for managing and supporting external code that isn't core to the codebase. Can this live on your own repo on GitHub for now? |
Apologies for not getting back sooner -- other commitments required my attention I've packaged this up at https://github.com/sjperkins/tfopgen. Its also available on pypi -- |
This script uses jinja2 templates to generate the following:
Operator inputs, outputs, polymorphic type attributes, other attributes and documentation can be specified.