tf.raw_ops.CrossReplicaSum
Stay organized with collections
Save and categorize content based on your preferences.
An Op to sum inputs across replicated TPU instances.
tf.raw_ops.CrossReplicaSum(
input, group_assignment, name=None
)
Each instance supplies its own input.
For example, suppose there are 8 TPU instances: [A, B, C, D, E, F, G, H]
.
Passing group_assignment=[[0,2,4,6],[1,3,5,7]]
sets A, C, E, G
as group 0,
and B, D, F, H
as group 1. Thus we get the outputs:
[A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H]
.
Args |
input
|
A Tensor . Must be one of the following types: half , bfloat16 , float32 , float64 , int32 , uint32 .
The local input to the sum.
|
group_assignment
|
A Tensor of type int32 . An int32 tensor with shape
[num_groups, num_replicas_per_group]. group_assignment[i] represents the
replica ids in the ith subgroup.
|
name
|
A name for the operation (optional).
|
Returns |
A Tensor . Has the same type as input .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2023-10-06 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-06 UTC."],[],[],null,["# tf.raw_ops.CrossReplicaSum\n\n\u003cbr /\u003e\n\nAn Op to sum inputs across replicated TPU instances.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.raw_ops.CrossReplicaSum`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/CrossReplicaSum)\n\n\u003cbr /\u003e\n\n tf.raw_ops.CrossReplicaSum(\n input, group_assignment, name=None\n )\n\nEach instance supplies its own input.\n\nFor example, suppose there are 8 TPU instances: `[A, B, C, D, E, F, G, H]`.\nPassing group_assignment=`[[0,2,4,6],[1,3,5,7]]` sets `A, C, E, G` as group 0,\nand `B, D, F, H` as group 1. Thus we get the outputs:\n`[A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H]`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `input` | A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`, `int32`, `uint32`. The local input to the sum. |\n| `group_assignment` | A `Tensor` of type `int32`. An int32 tensor with shape \\[num_groups, num_replicas_per_group\\]. `group_assignment[i]` represents the replica ids in the ith subgroup. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Tensor`. Has the same type as `input`. ||\n\n\u003cbr /\u003e"]]