什么是 tensorflow.python.ops
What is tensorflow.python.ops
我已经在tensorflow网站上搜索过了,但是找不到任何相关信息。不是tensorflowAPI吗?在哪里可以找到它的功能?
API 通常是为 end-users 保留的内容。像kerasAPI一样,我们经常使用keras来创建模型。 API 代表 'Application Programming Interface'。
但是,Ops 不适用于 end-users。 tensorflow API-s 使用它来运行。
例如。如果您使用 tf.data.Dataset
并对该数据集进行 map
操作,则您传递给 map
的函数将转换为您在 [=28] 中编写的函数的高度优化版本=].为此,可能会使用 tf.python.ops
。
来自 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:对于初学者,您不需要了解有关 tf.python.ops
的所有详细信息。用于后端。
这个回答有帮助吗?
我已经在tensorflow网站上搜索过了,但是找不到任何相关信息。不是tensorflowAPI吗?在哪里可以找到它的功能?
API 通常是为 end-users 保留的内容。像kerasAPI一样,我们经常使用keras来创建模型。 API 代表 'Application Programming Interface'。
但是,Ops 不适用于 end-users。 tensorflow API-s 使用它来运行。
例如。如果您使用 tf.data.Dataset
并对该数据集进行 map
操作,则您传递给 map
的函数将转换为您在 [=28] 中编写的函数的高度优化版本=].为此,可能会使用 tf.python.ops
。
来自 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:对于初学者,您不需要了解有关 tf.python.ops
的所有详细信息。用于后端。
这个回答有帮助吗?