tf.py_func(func, inp, Tout, stateful=True, name=None) Wraps a python function and uses it as a tensorflow op.