      features, labels = batch
      if labels.dtype != features.dtype:
          labels = labels.astype(features.dtype)
      return (gutils.split_and_load(features, ctx),
              gutils.split_and_load(labels, ctx),
              features.shape[0])
  
  
  def get_data_ch7():
      """Get the data set used in Chapter 7."""
      data = np.genfromtxt('../data/airfoil_self_noise.dat', delimiter='\t')
 
</s> remove         acc.wait_to_read()
    return acc.asscalar() / n
 </s> add         acc_sum.wait_to_read()
    return acc_sum.asscalar() / n </s> remove     acc = nd.array([0])
    n = 0
 </s> add     acc_sum, n = nd.array([0]), 0 </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         data_iter_fn = data_iter_consecutive
 </s> add         data_iter_fn = gb.data_iter_consecutive </s> remove         data_iter_fn = data_iter_random
 </s> add         data_iter_fn = gb.data_iter_random
            gutils.split_and_load(labels, ctx), features.shape[0])
      features, labels = batch
      if labels.dtype != features.dtype:
          labels = labels.astype(features.dtype)
      return (gutils.split_and_load(features, ctx),
            gutils.split_and_load(labels, ctx), features.shape[0])
            gutils.split_and_load(labels, ctx), features.shape[0])
  
  
  def get_data_ch7():
      """Get the data set used in Chapter 7."""
      data = np.genfromtxt('../data/airfoil_self_noise.dat', delimiter='\t')
keep keep keep keep replace replace keep keep keep keep keep
 gb 0.8.9, fix acc, loss computations 
gluonbook/utils.py