Returns a tensor with the reduce sum across `tensors`. The computation is done with a reduce operation, so only one tensor is returned. Args: tensors: The input tensors across which to sum; must be assigned to GPU devices. Returns: A tensor containing the sum of the input te
(tensors)
| 128 | |
| 129 | |
| 130 | def reduce_sum(tensors): |
| 131 | """Returns a tensor with the reduce sum across `tensors`. |
| 132 | |
| 133 | The computation is done with a reduce operation, so only one tensor is |
| 134 | returned. |
| 135 | |
| 136 | Args: |
| 137 | tensors: The input tensors across which to sum; must be assigned |
| 138 | to GPU devices. |
| 139 | |
| 140 | Returns: |
| 141 | A tensor containing the sum of the input tensors. |
| 142 | |
| 143 | Raises: |
| 144 | LookupError: If context is not currently using a GPU device. |
| 145 | """ |
| 146 | return _apply_reduce('sum', tensors) |
| 147 | |
| 148 | |
| 149 | @ops.RegisterGradient('NcclReduce') |
no test coverage detected