T
- data type for output()
outputpublic final class CollectivePermute<T> extends PrimitiveOp implements Operand<T>
Each instance supplies its own input.
For example, suppose there are 4 TPU instances: `[A, B, C, D]`. Passing source_target_pairs=`[[0,1],[1,2],[2,3],[3,0]]` gets the outputs: `[D, A, B, C]`.
operation
Modifier and Type | Method and Description |
---|---|
Output<T> |
asOutput()
Returns the symbolic handle of a tensor.
|
static <T> CollectivePermute<T> |
create(Scope scope,
Operand<T> input,
Operand<Integer> sourceTargetPairs)
Factory method to create a class wrapping a new CollectivePermute operation.
|
Output<T> |
output()
The permuted input.
|
equals, hashCode, op, toString
public static <T> CollectivePermute<T> create(Scope scope, Operand<T> input, Operand<Integer> sourceTargetPairs)
scope
- current scopeinput
- The local input to be permuted. Currently only supports float and
bfloat16.sourceTargetPairs
- A tensor with shape [num_pairs, 2].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.