tf.reduce_sum()_tf.reduce_mean()_tf.reduce_max()

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. If None (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 for keepdims.
  • 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)可忽略

猜你喜欢

转载自blog.csdn.net/hellocsz/article/details/89318474
今日推荐