IndexError Traceback (most recent call last)
in ()
18 adam.step()
19
---> 20 train_loss.append(loss.data[0])
21
22 if batch_id % 10 == 0:
IndexError: invalid index of a 0-dim tensor. Use tensor.item()
in Python or tensor.item<T>()
in C++ to convert a 0-dim tensor to a number