parameters: (sparse_ids, sparse_weights)
return_statement: return sparse_ids, sparse_weights
docstring: Prune invalid weights (< 0) from the input ids and weights.
docstring_summary: Prune invalid weights (< 0) from the input ids and weights.
docstring_tokens: Prune invalid weights ( < 0 ) from the input ids and weights .
function: def _prune_invalid_weights(sparse_ids, sparse_weights):
    """Prune invalid weights (< 0) from the input ids and weights."""
    if sparse_weights is not None:
      is_weights_valid = math_ops.greater(sparse_weights.values, 0)
      sparse_ids = sparse_ops.sparse_retain(sparse_ids, is_weights_valid)
      sparse_weights = sparse_ops.sparse_retain(sparse_weights, is_weights_valid)
    return sparse_ids, sparse_weights
function_tokens: def _prune_invalid_weights ( sparse_ids , sparse_weights ) : if sparse_weights is not None : is_weights_valid = math_ops . greater ( sparse_weights . values , 0 ) sparse_ids = sparse_ops . sparse_retain ( sparse_ids , is_weights_valid ) sparse_weights = sparse_ops . sparse_retain ( sparse_weights , is_weights_valid ) return sparse_ids , sparse_weights