Closed mrmitzh closed 5 years ago
When pytorch version is greater than 0.5, we should use tensor.item() to convert a 0-dim tensor to a Python number. Otherwise we would not be able to train because of IndexError: invalid index of a 0-dim tensor problem.
When pytorch version is greater than 0.5, we should use tensor.item() to convert a 0-dim tensor to a Python number. Otherwise we would not be able to train because of IndexError: invalid index of a 0-dim tensor problem.