Build a 0/1 mask of non-padding tokens: 1 where the id differs from pad_id, 0 where it equals pad_id.
Implement solve(ids,pad_id).
Returns. Return an integer NumPy array of the same shape as ids.
Example 1
Input:
solve([1, 2, 3], 2)
Output:
[1, 0, 1]
Example 2
Input:
solve([7, 7, 0, 0], 0)
Output:
[1, 1, 0, 0]
No results yet
Run your code to check it against the examples, or submit to run every test.