                  y_hat = net(X)
                  l = loss(y_hat, y)
              l.backward()
              trainer.step(batch_size)
              train_l_sum += l.mean().asscalar()
              train_acc_sum += accuracy(y_hat, y)
          test_acc = evaluate_accuracy(test_iter, net, ctx)
          print('epoch %d, loss %.4f, train acc %.3f, test acc %.3f, '
                'time %.1f sec'
                % (epoch, train_l_sum / len(train_iter),
                   train_acc_sum / len(train_iter), test_acc, time.time() - start))
 
</s> remove               % (epoch, train_l_sum / len(train_iter),
                 train_acc_sum / len(train_iter), test_acc, time.time() - start))
 </s> add               % (epoch + 1, train_l_sum / n, train_acc_sum / n, test_acc,
                 time.time() - start)) </s> remove             train_l_sum += l.mean().asscalar()
            train_acc_sum += accuracy(y_hat, y)
 </s> add             y = y.astype('float32')
            train_l_sum += l.asscalar()
            train_acc_sum += (y_hat.argmax(axis=1) == y).sum().asscalar()
            n += y.size </s> remove               % (epoch, train_l_sum / n, train_acc_sum / m, test_acc,
 </s> add               % (epoch + 1, train_l_sum / n, train_acc_sum / m, test_acc, </s> remove             train_l_sum += sum([l.sum().asscalar() for l in ls])
            trainer.step(batch_size)
            n += batch_size
 </s> add  </s> remove               % (epoch, train_l_sum / len(train_iter),
                 train_acc_sum / len(train_iter), test_acc))
 </s> add               % (epoch + 1, train_l_sum / n, train_acc_sum / n, test_acc))
            y = y.astype('float32')
            train_l_sum += l.asscalar()
            train_acc_sum += (y_hat.argmax(axis=1) == y).sum().asscalar()
            n += y.size
                  y_hat = net(X)
                  l = loss(y_hat, y)
              l.backward()
              trainer.step(batch_size)
            y = y.astype('float32')
            train_l_sum += l.asscalar()
            train_acc_sum += (y_hat.argmax(axis=1) == y).sum().asscalar()
            n += y.size
            y = y.astype('float32')
            train_l_sum += l.asscalar()
            train_acc_sum += (y_hat.argmax(axis=1) == y).sum().asscalar()
            n += y.size
          test_acc = evaluate_accuracy(test_iter, net, ctx)
          print('epoch %d, loss %.4f, train acc %.3f, test acc %.3f, '
                'time %.1f sec'
                % (epoch, train_l_sum / len(train_iter),
                   train_acc_sum / len(train_iter), test_acc, time.time() - start))
keep keep keep keep replace replace keep keep keep keep keep
 gb 0.8.9, fix acc, loss computations 
gluonbook/utils.py