tf.reduce_sum(input_tensor,axis=None,keepdims=None,name=None,reduction_indices=None,keep_dims=None)
Args:
input_tensor
: The tensor to reduce. Should have numeric type. #输入axis
: The dimensions to reduce. IfNone
(the default), reduces all dimensions. Must be in the range (rank(input_tensor), rank(input_tensor))
.#取0第一维,取1第二维,取-1最后一维keepdims
: If true, retains reduced dimensions with length 1.#按照原来的维度name
: A name for the operation (optional).reduction_indices
: The old (deprecated) name for axis.#axis的原来的名字keep_dims
: Deprecated alias forkeepdims
.-
reduce_sum应该理解为压缩求和 用于降维
求最大值tf.reduce_max(input_tensor, reduction_indices=None, keep_dims=False, name=None)
求平均值tf.reduce_mean(input_tensor, reduction_indices=None, keep_dims=False, name=None)
参数1--input_tensor:待求值的tensor。
参数2--reduction_indices:在哪一维上求解。
参数(3)(4)可忽略