          for X, y in zip(features, labels):
              y = y.astype('float32')
              acc += (net(X).argmax(axis=1) == y).sum().copyto(mx.cpu())
              n += y.size
          acc.wait_to_read()
      return acc.asscalar() / n
  
  
  def _get_batch(batch, ctx):
      """Return features and labels on ctx."""
      features, labels = batch
 
</s> remove             acc += (net(X).argmax(axis=1) == y).sum().copyto(mx.cpu())
 </s> add             acc_sum += (net(X).argmax(axis=1) == y).sum().copyto(mx.cpu()) </s> remove     acc = nd.array([0])
    n = 0
 </s> add     acc_sum, n = nd.array([0]), 0 </s> remove             gutils.split_and_load(labels, ctx),
            features.shape[0])
 </s> add             gutils.split_and_load(labels, ctx), features.shape[0]) </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             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
        acc_sum.wait_to_read()
    return acc_sum.asscalar() / n
          for X, y in zip(features, labels):
              y = y.astype('float32')
              acc += (net(X).argmax(axis=1) == y).sum().copyto(mx.cpu())
              n += y.size
        acc_sum.wait_to_read()
    return acc_sum.asscalar() / n
        acc_sum.wait_to_read()
    return acc_sum.asscalar() / n
  
  
  def _get_batch(batch, ctx):
      """Return features and labels on ctx."""
      features, labels = batch
keep keep keep keep replace replace keep keep keep keep keep
 gb 0.8.9, fix acc, loss computations 
gluonbook/utils.py