fois
fois

Reputation: 472

Adding new operations in Tensorflow using an approach different from tutorial

Here is a tutorial about how to add a new operation in TensorFlow. It talks about how to create a shared object and load it in python.

However, there are some operations, which located in core/kernels, didn't generate shared object. Instead, TF will generate files like gen_some_ops.py in dist-packages/tensorflow/python/ops.

If I want to use the second approach to add a new operation (say zero_out), then what should I do (in addition to the tutorial)?

Thanks.

Upvotes: 0

Views: 158

Answers (1)

drpng
drpng

Reputation: 1637

The core operators are in _pywrap_tensorflow.so. If you plan on contributing to the core, that's where they would go. Typically, though, we would first accept them into the contrib directory, then at a later stage move into the core. It's best to file a github issue before you start working to coordinate with us.

If you're not planning on contributing back, then the user_ops path is the most appropriate. That way you can have some level of version-independence.

Upvotes: 2

Related Questions