T
- data type for out()
outputpublic final class CumulativeLogsumexp<T extends Number> extends PrimitiveOp implements Operand<T>
By default, this op performs an inclusive cumulative log-sum-exp, which means that the first element of the input is identical to the first element of the output:
tf.math.cumulative_logsumexp([a, b, c]) # => [a, log(exp(a) + exp(b)), log(exp(a) + exp(b) + exp(c))]
By setting the `exclusive` kwarg to `True`, an exclusive cumulative log-sum-exp is
performed instead:
tf.cumulative_logsumexp([a, b, c], exclusive=True) # => [-inf, a, log(exp(a) * exp(b))]
Note that the neutral element of the log-sum-exp operation is `-inf`,
however, for performance reasons, the minimal value representable by the
floating point type is used instead.
By setting the `reverse` kwarg to `True`, the cumulative log-sum-exp is performed in the opposite direction.
Modifier and Type | Class and Description |
---|---|
static class |
CumulativeLogsumexp.Options
Optional attributes for
CumulativeLogsumexp |
operation
Modifier and Type | Method and Description |
---|---|
Output<T> |
asOutput()
Returns the symbolic handle of a tensor.
|
static <T extends Number,U extends Number> |
create(Scope scope,
Operand<T> x,
Operand<U> axis,
CumulativeLogsumexp.Options... options)
Factory method to create a class wrapping a new CumulativeLogsumexp operation.
|
static CumulativeLogsumexp.Options |
exclusive(Boolean exclusive) |
Output<T> |
out() |
static CumulativeLogsumexp.Options |
reverse(Boolean reverse) |
equals, hashCode, op, toString
public static <T extends Number,U extends Number> CumulativeLogsumexp<T> create(Scope scope, Operand<T> x, Operand<U> axis, CumulativeLogsumexp.Options... options)
scope
- current scopex
- A `Tensor`. Must be one of the following types: `float16`, `float32`, `float64`.axis
- A `Tensor` of type `int32` (default: 0). Must be in the range
`[-rank(x), rank(x))`.options
- carries optional attributes valuespublic static CumulativeLogsumexp.Options exclusive(Boolean exclusive)
exclusive
- If `True`, perform exclusive cumulative log-sum-exp.public static CumulativeLogsumexp.Options reverse(Boolean reverse)
reverse
- A `bool` (default: False).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 extends Number>
OperationBuilder.addInput(Output)
Copyright © 2022. All rights reserved.