I have been working on TF 2.0 and the custom op tutorial presented here does allow execution of the op.
This is mainly due to eager execution and different custom op handling.
In order to call a custom op in python one must:
Start docker image
docker pull tensorflow/tensorflow:nightly-custom-op-ubuntu16
docker run -it --rm tensorflow/tensorflow:nightly-custom-op-ubuntu16 /bin/bash
Inside docker
git clone https://github.com/tensorflow/custom-op.git
cd custom-op
Build the pip package with bazel
./configure.sh
bazel build build_pip_pkg
bazel-bin/build_pip_pkg artifacts
Install the pip package
pip install artifacts/*.whl
Test the package
cd .. # Super important, otherwise python can't see the tensorflow_zero_out kernel
python -c "import tensorflow as tf;import tensorflow_zero_out as myop;print(myop.zero_out([[1,2], [3,4]]))"