[英]What is tensorflow.python.ops
I have searched it in tensorflow website, but I can not find any information about it.我在 tensorflow 网站上搜索过它,但找不到任何有关它的信息。 Is it not a tensorflow API?
不是tensorflow API吗? Where can I find it's function?
我在哪里可以找到它的功能?
API is usually something reserved for end-users. API 通常是为最终用户保留的。 Like keras API, we frequently use keras to create models.
和 keras API 一样,我们经常使用 keras 来创建模型。 The API stands for 'Application Programming Interface'.
API 代表“应用程序编程接口”。 The Ops however, is not intended for end-users.
然而,Ops 并非面向最终用户。 It is used by tensorflow API-s to function.
tensorflow API-s 使用它来运行。 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.如果您使用
tf.data.Dataset
并对该数据集进行map
操作,则您传递到map
的函数将转换为您在 Python 中编写的高度优化版本。 For that, tf.python.ops
might be used.为此,可能会使用
tf.python.ops
。
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.
Operation 是 tf.Graph 中的一个节点,它以零个或多个 Tensor 对象作为输入,并产生零个或多个 Tensor 对象作为输出。 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.
Operation 类型的对象是通过在 tf.function 内或在 tf.Graph.as_default 上下文管理器下调用 Python op 构造函数(例如 tf.matmul)来创建的。
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.例如,在 tf.function 中, c = tf.matmul(a, b) 创建了一个“MatMul”类型的操作,它以张量 a 和 b 作为输入,并产生 c 作为输出。
TL;DR: For starters, you don't need to know all the details about tf.python.ops
. TL;DR:首先,您不需要了解有关
tf.python.ops
所有详细信息。 It's used in backend.它用于后端。
Did this answer help?这个答案有帮助吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.