Prune invalid weights (< 0) from the input ids and weights.
(sparse_ids, sparse_weights)
| 2066 | |
| 2067 | |
| 2068 | def _prune_invalid_weights(sparse_ids, sparse_weights): |
| 2069 | """Prune invalid weights (< 0) from the input ids and weights.""" |
| 2070 | if sparse_weights is not None: |
| 2071 | is_weights_valid = math_ops.greater(sparse_weights.values, 0) |
| 2072 | sparse_ids = sparse_ops.sparse_retain(sparse_ids, is_weights_valid) |
| 2073 | sparse_weights = sparse_ops.sparse_retain(sparse_weights, is_weights_valid) |
| 2074 | return sparse_ids, sparse_weights |
no test coverage detected