Build the padding mask for attention: given a row of token ids, mark every position that holds a real token (True) and every position equal to pad_id (False).
Implement solve(ids, pad_id).
Returns. Return a boolean NumPy array of the same length as ids.
Example 1
Input:
solve([5, 6, 0, 0], 0)
Output:
[True, True, False, False]
Example 2
Input:
solve([[3, 0], [4, 5]], 0)
Output:
[[True, False], [True, True]]
No results yet
Run your code to check it against the examples, or submit to run every test.