Skip to content

Commit

Permalink
fix deprecated loss access (pytorch#113)
Browse files Browse the repository at this point in the history
Addressing pytorch#108
  • Loading branch information
sauercrowd authored and szagoruyko committed Feb 3, 2019
1 parent 511db2b commit fb7709a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchnet/logger/meterlogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def update_loss(self, loss, meter='loss'):
loss = self.__to_tensor(loss)
if meter not in self.meter.keys():
self.__addloss(meter)
self.meter[meter].add(loss[0])
self.meter[meter].add(loss.item())

def peek_meter(self):
'''Returns a dict of all meters and their values.'''
Expand Down

0 comments on commit fb7709a

Please sign in to comment.