C3M3Lab1: glitch in unittests.exercise_3

Problem: Decoder’s forward method takes three arguments: tgt, memory, memory_padding_mask=None. The last argument is a keyword argument named memory_padding_mask. The issue is the unit test for exercise 3 uses a different name for the keyword argument: mask_input instead of memory_padding_mask. This creates an error during unit test if you define user decoded variable by calling decoder with the correct argument name in the exercise. e.g.

output = self.decoder(tgt, memory, memory_padding_mask = src_padding_mask)

Currently, you instead need to pass the arguments without the keyword to pass the unit test. e.g.

output = self.decoder(tgt, memory, src_padding_mask)

This is not a desirable behavior.

Suggested solution:

Update unittest.py to use matching keyword name when you define the wrapper function to track. e.g.

## Currently Line 1806
def tracked_decoder(tgt_input, memory_input, mask_input=None):

## Suggested
def tracked_decoder(tgt_input, memory_input, memory_padding_mask=None):

## Currently Line 1853
def check_mask_passing(tgt_input, memory_input, mask_input=None):

## Suggested
def check_mask_passing(tgt_input, memory_input, memory_padding_mask=None):

Also change the statements inside the function body accordingly whenever the keyword mask_input is used.

1 Like

Hi! Thanks for flaggings this! I’m looking into it right now. I’ll return to you once it is fixed.

1 Like