codecamp

TensorFlow函数:tf.tuple

tf.tuple函数

tf.tuple(
    tensors,
    name=None,
    control_inputs=None
)

定义在:tensorflow/python/ops/control_flow_ops.py.

请参阅指南:控制流程>控制流程操作

将张量组合在一起.

这将创建一个与 tensors 参数具有相同值的张量元组,但是每个张量的值仅在所有张量的值已经被计算之后才返回.

control_inputs 包含此操作完成之前必须完成的其他操作,但其输出未返回.

这可以用作并行计算的“连接”机制:所有参数张量可以并行计算,但 tuple 返回的任何张量返回的值仅在所有并行计算完成后才可用.

另请参阅 tf.grouptf.control_dependencies.

函数参数:

  • tensors:Tensors 或者 IndexedSlices 列表,一些条目的可以是 None.
  • name:(可选)用作 name_scope 操作的名称.
  • control_inputs:返回之前完成的其他操作的列表.

函数返回值:

tf.tuple 函数的返回值与 tensors 相同.

可能引发的异常:

  • ValueError:如果 tensors 不包含任何 Tensor 或 IndexedSlices.
  • TypeError:如果 control_inputs 不是一个 Operation 或 Tensor 对象列表.
TensorFlow函数:tf.truncatemod
TensorFlow函数:tf.uniform_unit_scaling_initializer
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }