codecamp

TensorFlow函数:tf.sparse_reduce_sum_sparse

tf.sparse_reduce_sum_sparse 函数

sparse_reduce_sum_sparse(
    sp_input,
    axis=None,
    keep_dims=False,
    reduction_axes=None
)

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

参见指南:稀疏张量>减少

计算 SparseTensor 各个维度上元素的总和.

这个操作需要一个 SparseTensor,并且是 tf.reduce_sum() 的稀疏对应.与 SparseReduceSum 相反,这个操作返回一个 SparseTensor.

沿着 reduction_axes 给定的维度减少 sp_input.除非 keep_dims 是真的,否则 reduction_axes 中的每个条目的张量的秩都减少了1.如果 keep_dims 属实,那么减少的维度将保留为1.

如果 reduction_axes 没有条目,则减少所有维度,并返回具有单个元素的张量.另外,坐标轴可以是负值,根据 Python 中的索引规则进行解释.

函数参数:

  • sp_input:需要减少的 SparseTensor,应该是数字类型.
  • axis:要减少的维度;列表或标量.如果为 None(默认),则减少所有的维度.
  • keep_dims:如果为 true,则保留长度为1的减少维度.
  • reduction_axes:坐标轴的弃用名称.

函数返回值:

tf.sparse_reduce_sum_sparse函数返回减少的 SparseTensor.

参考文章

TensorFlow函数:tf.sparse_reduce_max_sparse

TensorFlow函数:tf.sparse_reduce_sum
TensorFlow函数:tf.sparse_reorder
温馨提示
下载编程狮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; }