tensoreflusso:: ops:: cumsum

#include <math_ops.h>

Calcola la somma cumulativa del tensore x lungo axis .

Riepilogo

Per impostazione predefinita, questa operazione esegue un cumsum inclusivo, il che significa che il primo elemento dell'input è identico al primo elemento dell'output:

tf.cumsum([a, b, c])  # => [a, a + b, a + b + c]

Impostando kwarg exclusive su True , viene invece eseguito un cumsum esclusivo:

tf.cumsum([a, b, c], exclusive=True)  # => [0, a, a + b]

Impostando il kwarg reverse su True , il cumsum viene eseguito nella direzione opposta:

tf.cumsum([a, b, c], reverse=True)  # => [a + b + c, b + c, c]

Questo è più efficiente rispetto all'utilizzo di operazioni tf.reverse separate.

I kwarg reverse ed exclusive possono anche essere combinati:

tf.cumsum([a, b, c], exclusive=True, reverse=True)  # => [b + c, c, 0]

Argomenti:

  • scope: un oggetto Scope
  • x: un Tensor . Deve essere uno dei seguenti tipi: float32 , float64 , int64 , int32 , uint8 , uint16 , int16 , int8 , complex64 , complex128 , qint8 , quint8 , qint32 , half .
  • asse: un Tensor di tipo int32 (impostazione predefinita: 0). Deve essere compreso nell'intervallo [-rank(x), rank(x)) .

Attributi facoltativi (vedi Attrs ):

  • esclusivo: se True , esegue il cumsum esclusivo.
  • reverse: A bool (default: False).

Ritorna:

Costruttori e distruttori

Cumsum (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input axis)
Cumsum (const :: tensorflow::Scope & scope, :: tensorflow::Input x, :: tensorflow::Input axis, const Cumsum::Attrs & attrs)

Attributi pubblici

operation
out

Funzioni pubbliche

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

Funzioni pubbliche statiche

Exclusive (bool x)
Reverse (bool x)

Strutture

tensorflow:: ops:: Cumsum:: Attrs

Setter di attributi facoltativi per Cumsum .

Attributi pubblici

operazione

Operation operation

fuori

::tensorflow::Output out

Funzioni pubbliche

cumsum

 Cumsum(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input x,
  ::tensorflow::Input axis
)

cumsum

 Cumsum(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input x,
  ::tensorflow::Input axis,
  const Cumsum::Attrs & attrs
)

nodo

::tensorflow::Node * node() const 

operatore::tensorflow::Input

 operator::tensorflow::Input() const 

operatore::tensorflow::Output

 operator::tensorflow::Output() const 

Funzioni pubbliche statiche

Esclusivo

Attrs Exclusive(
  bool x
)

Inversione

Attrs Reverse(
  bool x
)