Where is the gen_math_ops script in the tensor stream?

I read the source code of the tensor stream on github and found gen_math_ops.

from tensorflow.python.ops import gen_math_ops 

However, I can not find this script in the whole project, and also not in the ops folder.

search results

No gen_math_ops under ops

+6
source share
3 answers

It is automatically generated by tf_gen_op_wrapper_* rules here .

Also can you use? in your ipython laptop to find the location

screenshot example from genmathops

+9
source

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

In my case, I was interested in the inner workings of gen_array_ops._concat. It turns out that gen * .py automatically creates wrappers for the C ++ kernels located here . You can usually assume that the name op op of the kernel, for example here , was what interested me.

+4
source

This file is generated by the machine.

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

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

+1
source

All Articles