How to find a class or function in a Python module?

断了今生、忘了曾经 提交于 2019-12-02 03:03:37

tensorflow.python.ops.gen_dataset_ops is generated code. (That's why they put gen in front of the name.) You can't find it in the source repository because it's not in the source repository; it only comes into existence during the Tensorflow build process.

If you have Tensorflow installed, you should be able to find gen_dataset_ops.py under tensorflow/python/ops/gen_dataset_ops.py in your Tensorflow installation.

I would navigate to your python directory (this example is for a virtualenv on ubuntu):

~/pyEnvs/env1/lib/python2.7/site-packages/tensorflow/python/ops.py and open that file. In that file, use Ctrl+F and find the function you are looking for.

My answer assumes you know where your python environment is installed and that you installed tensorflow using pip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!