# UNQ_C3 help with mask

I cant understand what is the mask the exercise want me to generate. please help

# generate the mask to distinguish real tokens from padding
# hint: inputs is positive for real tokens and 0 where they are padding
mask = [None]

A pad token has value 0. Mask conveys information about which positions are padded.

  1. Mask should be the same shape as inputs.
  2. If we consider a single input, mask[i] = 1, if input[i] is positive, 0 otherwise.
  3. The above step needs to be done for all inputs.
2 Likes