When i try to import classes from a python file and use them in collab it throws a name error ,but when i copy and paste the same code and run it in a cell in collab it works just fine . the error is very wierd it will always show the same line as the source of the error .. even if it is blank
i've tried fixing the indentation. it does'nt seem to work
loss = F.nll_loss(output, target)
if self.targeted:
loss = -loss
self.model.zero_grad()
it throws name error at the blank line saying name device is not defined