Skip to content

Commit

Permalink
.result() returns a tensor where .numpy() will return a value.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 235457599
  • Loading branch information
yashk2810 authored and lamberta committed Feb 25, 2019
1 parent 30db916 commit 8be2848
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tensorflow_examples/test_models/densenet/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,10 @@ def custom_loop(self, train_dataset, test_dataset, model):
self.test_loss_metric.reset_states()
self.test_acc_metric.reset_states()

return (self.train_loss_metric.result(), self.train_acc_metric.result(),
self.test_loss_metric.result(), self.test_acc_metric.result())
return (self.train_loss_metric.result().numpy(),
self.train_acc_metric.result().numpy(),
self.test_loss_metric.result().numpy(),
self.test_acc_metric.result().numpy())


def run_main(argv):
Expand Down

0 comments on commit 8be2848

Please sign in to comment.