Where is gen_math_ops script in tensorflow?

后端 未结 4 1455
情深已故
情深已故 2020-12-15 05:42

I read the source code of tensorflow on github and find gen_math_ops is imported.

from tensorflow.python.ops import gen_math_ops

However, i

相关标签:
4条回答
  • 2020-12-15 05:55

    Just to add to the previous answers, if your goal is to inspect the source code, try inspect.get_source:

    0 讨论(0)
  • 2020-12-15 05:57

    This file is machine generated.

    You can find the generated file in .../site-packages/tensorflow/python/ops/gen_math_ops.py

    For example, in Mac, you can find it at /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/ops/gen_math_ops.py.

    0 讨论(0)
  • 2020-12-15 06:00

    Yaroslav has the right answer, but the link he provided is now broken. Here's a correct link to tensorflow.bzl.

    In my case, I was interested in the internal workings of gen_array_ops._concat . It turns out that the gen*.py are automatically generated wrappers for the C++ kernels located here. You can typically guess the kernel op name, e.g., here was the one I was interested in.

    0 讨论(0)
  • 2020-12-15 06:18

    It's automatically generated by tf_gen_op_wrapper_* rules here.

    Also you can use ?? in your IPython notebook to find location

    0 讨论(0)
提交回复
热议问题