NLP C3_W3: classify() hits shape error by the grader

The classify() function in the assignment notebook of this course has the following snippet of code:

_, n_feat = ??

What’s that and how to make use of it? I comment it out and it passes w3_unittest.test_classify(classify, model) but fails the grader with 0 point. Although I pass the course with 80%, this is not something that I should overlook.

The error message I get from the autograder is:

There was an error grading your submission. Details:\noperands could not be broadcast together with shapes (3500,64) (3500,0) 

Any idea what’s the root cause of this error?

it says get the embedding shape, you obtain it from a tuple made up of 2 dimensions. You need the n_feat for further processing, you dont need the other one in this context!

Not clear to me how this is useful in the function. I just ignored it and the prediction still work,

The shape is 2 values you need to assign them both to a separate variable, the ‘_’ variable you don’t really use it that why its written as ‘_’ !

Anybody has any input on this?

see if this explanation helps

n_feat variable is redundant, i.e., not used anywhere in the function. The concern here is the error output by the autograder:

There was an error grading your submission. Details:\noperands could not be broadcast together with shapes (3500,64) (3500,0) 

it is not redundant, read the trailing sentence which mentions the n_, feature get you the dimensionality of model prediction. so how recall this code will determine the pred shape which in your case, you have probably mentioned it as v1.v2

You can send me screenshot of all grade functions where you’re failing test by personal DM