aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/docs_src/extend/adding_an_op.md
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/docs_src/extend/adding_an_op.md')
-rw-r--r--tensorflow/docs_src/extend/adding_an_op.md11
1 files changed, 5 insertions, 6 deletions
diff --git a/tensorflow/docs_src/extend/adding_an_op.md b/tensorflow/docs_src/extend/adding_an_op.md
index 4fc4c2faa2..45f7530506 100644
--- a/tensorflow/docs_src/extend/adding_an_op.md
+++ b/tensorflow/docs_src/extend/adding_an_op.md
@@ -229,7 +229,7 @@ do the following to run it from Python :
```python
import tensorflow as tf
-zero_out_module = tf.load_op_library('zero_out.so')
+zero_out_module = tf.load_op_library('./zero_out.so')
with tf.Session(''):
zero_out_module.zero_out([[1, 2], [3, 4]]).eval()
@@ -243,14 +243,13 @@ named `ZeroOut` in the C++ files, the python function will be called `zero_out`.
To make the op available as a regular function `import`-able from a Python
module, it maybe useful to have the `load_op_library` call in a Python source
-file as follows (see [zero_out_op_1.py](https://www.tensorflow.org/code/tensorflow/examples/adding_an_op/zero_out_op_1.py))
-:
+file as follows:
```python
import tensorflow as tf
-_zero_out_module = tf.load_op_library('zero_out_op_kernel_1.so')
-zero_out = _zero_out_module.zero_out
+zero_out_module = tf.load_op_library('./zero_out.so')
+zero_out = zero_out_module.zero_out
```
## Verify that the op works
@@ -264,7 +263,7 @@ import tensorflow as tf
class ZeroOutTest(tf.test.TestCase):
def testZeroOut(self):
- zero_out_module = tf.load_op_library('zero_out.so')
+ zero_out_module = tf.load_op_library('./zero_out.so')
with self.test_session():
result = zero_out_module.zero_out([5, 4, 3, 2, 1])
self.assertAllEqual(result.eval(), [5, 0, 0, 0, 0])