T
- data type for sum()
output@Operator(group="math") public final class AccumulateN<T> extends PrimitiveOp implements Operand<T>
`tf.accumulate_n_v2` performs the same operation as `tf.add_n`, but does not wait for all of its inputs to be ready before beginning to sum. This can save memory if inputs are ready at different times, since minimum temporary storage is proportional to the output size rather than the inputs size.
Unlike the original `accumulate_n`, `accumulate_n_v2` is differentiable.
Returns a `Tensor` of same shape and type as the elements of `inputs`.
operation
Modifier and Type | Method and Description |
---|---|
Output<T> |
asOutput()
Returns the symbolic handle of a tensor.
|
static <T> AccumulateN<T> |
create(Scope scope,
Iterable<Operand<T>> inputs,
Shape shape)
Factory method to create a class wrapping a new AccumulateN operation.
|
Output<T> |
sum() |
equals, hashCode, op, toString
public static <T> AccumulateN<T> create(Scope scope, Iterable<Operand<T>> inputs, Shape shape)
scope
- current scopeinputs
- A list of `Tensor` objects, each with same shape and type.shape
- Shape of elements of `inputs`.public Output<T> asOutput()
Operand
Inputs to TensorFlow operations are outputs of another TensorFlow operation. This method is used to obtain a symbolic handle that represents the computation of the input.
asOutput
in interface Operand<T>
OperationBuilder.addInput(Output)
Copyright © 2022. All rights reserved.