简体   繁体   中英

What is tensorflow.python.ops

I have searched it in tensorflow website, but I can not find any information about it. Is it not a tensorflow API? Where can I find it's function?

API is usually something reserved for end-users. Like keras API, we frequently use keras to create models. The API stands for 'Application Programming Interface'. The Ops however, is not intended for end-users. It is used by tensorflow API-s to function. For example. If you use a tf.data.Dataset and you make a map operation on that dataset, the function that you pass into the map is converted to a highly optimized version of what you wrote in python. For that, tf.python.ops might be used.
From source

An Operation is a node in a tf.Graph that takes zero or more Tensor objects as input, and produces zero or more Tensor objects as output. Objects of type Operation are created by calling a Python op constructor (such as tf.matmul) within a tf.function or under a tf.Graph.as_default context manager.
For example, within a tf.function, c = tf.matmul(a, b) creates an Operation of type "MatMul" that takes tensors a and b as input, and produces c as output.

TL;DR: For starters, you don't need to know all the details about tf.python.ops . It's used in backend.

Did this answer help?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM