I am having errors when the unittest in exercise 1, prune_model, tests the edge cases with amount=0.0 and amount=1.0, my error here is:
Failed test case: Missing pruning reparam attributes after amount=0.0.
Expected: weight_orig and weight_mask present
Got: has weight_orig? False, weight_mask? False
Failed test case: Missing pruning reparam attributes after amount=0.0.
Expected: weight_orig and weight_mask present
Got: has weight_orig? False, weight_mask? False
Failed test case: Missing pruning reparam attributes after amount=1.0.
Expected: weight_orig and weight_mask present
Got: has weight_orig? False, weight_mask? False
Failed test case: Missing pruning reparam attributes after amount=1.0.
Expected: weight_orig and weight_mask present
Got: has weight_orig? False, weight_mask? False
Failed test case: Conv layer missing weight_mask after ln_structured..
Expected: weight_mask present
Got: Absent
Failed test case: Linear layer missing weight_mask after ln_structured..
Expected: weight_mask present
Got: Absent
Failed test case: Expected ValueError for invalid mode, but none was raised..
Expected: Raise ValueError
Got: No error
I didn’t touch the for loop condition, I am using hasattr() to check if the module has the “weight” attribute, and comparing the mode string for “l1_unstructured” or “ln_structured”. Also passing the amount parameter into the prune function calls. The prune functions are being called by themselves not assigned to anything just like just like in the “Introduction to Pruning” practice lab. Any ideas? I’m not sure if I can share the whole code.