Helper function for unsorted segment ops. Gathers params for positive segment ids and gathers 0 for inputs with negative segment id.
| 1278 | // Gathers params for positive segment ids and gathers 0 for inputs with |
| 1279 | // negative segment id. |
| 1280 | Output GatherDropNegatives(const Scope& scope, const Output& params, |
| 1281 | Output& zero_clipped_indices, Output& is_positive) { |
| 1282 | auto gathered = Gather(scope, params, zero_clipped_indices); |
| 1283 | // Replace gathered params of negative indices with 0. |
| 1284 | auto zero_slice = ZerosLike(scope, gathered); |
| 1285 | return SelectV2(scope, is_positive, gathered, zero_slice); |
| 1286 | } |
| 1287 | |
| 1288 | Status UnsortedSegmentMinOrMaxGrad(const Scope& scope, const Operation& op, |
| 1289 | const std::vector<Output>& grad_inputs, |
no test coverage detected