W3cubDocs

/TensorFlow C++

tensorflow::ops::Sum

#include <math_ops.h>

Computes the sum of elements across dimensions of a tensor.

Summary

Reduces input along the dimensions given in axis. Unless keep_dims is true, the rank of the tensor is reduced by 1 for each entry in axis. If keep_dims is true, the reduced dimensions are retained with length 1.

Arguments:

  • scope: A Scope object
  • input: The tensor to reduce.
  • axis: The dimensions to reduce. Must be in the range [-rank(input), rank(input)).

Optional attributes (see Attrs):

  • keep_dims: If true, retain reduced dimensions with length 1.

Returns:

Aliases:

  • ReduceSum
Constructors and Destructors
Sum(const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input axis)
Sum(const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input axis, const Sum::Attrs & attrs)
Public attributes
output
Public functions
node() const
::tensorflow::Node *
operator::tensorflow::Input() const
operator::tensorflow::Output() const
Public static functions
KeepDims(bool x)
Structs
tensorflow::ops::Sum::Attrs

Optional attribute setters for Sum.

Public attributes

output

::tensorflow::Output output

Public functions

Sum

 Sum(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input axis
)

Sum

 Sum(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input axis,
  const Sum::Attrs & attrs
)

node

::tensorflow::Node * node() const 

operator::tensorflow::Input

operator::tensorflow::Input() const 

operator::tensorflow::Output

operator::tensorflow::Output() const 

Public static functions

KeepDims

Attrs KeepDims(
  bool x
)

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/sum.html