C1W4: Cell #7. Can't compile the student's code. Error: RuntimeError("Expected object of scalar type Long but got scalar type Float for sequence element 1 in sequence argument at position #1 'tensors'",)

My code passes all the test cases and seems to be correct. However, When I submit the assignment, it gives error as mentioned in the subject. I will be thankful if anyone guides me.

Hi, @timmy_timmy! I’ll try to help you.
Firstly, to be sure we’re on the same page Cell #7 is UNQ_C1, correct?
Secondly, does the grader error occur while processing UNQ_C1 or another cell where the method is called? The implementation of UNQ_C1 is quite simple so not sure what exactly is going wrong but no worries we’ll resolve it after you provide the information above. Thanks.

This post might be helpful: Issue with Programming Assignment: Conditional GAN Grading

@Dmitriy_Khvan, Thank you for responding to my query. I am not sure where the problem lies. I solved all the questions and passed the test cases provided in the notebook. I only get the error that is mentioned in the subject. Is it allowed to share my solutions? If not, what about the Pseudo code?

@Wendy, Thank you for your response. It seems that I get the same error mentioned in the query you referred but I can’t understand. Could you please explain to me?

@Wendy and @Dmitriy_Khvan, Thank you for your help. I got the help from the link @Wendy provided. In UNQ_C4, I was calling “torch.cat” instead of “combine_vectors.”

1 Like