issue:
self.state['loss_batch'] = self.state['loss'].data[0]
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
solution:
self.state['loss_batch'] = self.state['loss'].item()
issue:
self.state['loss_batch'] = self.state['loss'].data[0]
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
solution:
self.state['loss_batch'] = self.state['loss'].item()