This is the code as described in https://tensorflow.org/guide/create_op. See ../custom_ops_doc for more examples.
../custom_ops_doc