MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GatherDropNegatives

Function GatherDropNegatives

tensorflow/cc/gradients/math_grad.cc:1280–1286  ·  view source on GitHub ↗

Helper function for unsorted segment ops. Gathers params for positive segment ids and gathers 0 for inputs with negative segment id.

Source from the content-addressed store, hash-verified

1278// Gathers params for positive segment ids and gathers 0 for inputs with
1279// negative segment id.
1280Output 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
1288Status UnsortedSegmentMinOrMaxGrad(const Scope& scope, const Operation& op,
1289 const std::vector<Output>& grad_inputs,

Callers 2

UnsortedSegmentSumGradFunction · 0.85

Calls 2

GatherFunction · 0.50
ZerosLikeFunction · 0.50

Tested by

no test coverage detected