                            lr, clipping_theta, batch_size, pred_period,
                            pred_len, prefixes):
      """Train an RNN model and predict the next item in the sequence."""
      if is_random_iter:
          data_iter_fn = data_iter_random
      else:
          data_iter_fn = data_iter_consecutive
      params = get_params()
      loss = gloss.SoftmaxCrossEntropyLoss()
  
 
</s> remove         data_iter_fn = data_iter_consecutive
 </s> add         data_iter_fn = gb.data_iter_consecutive </s> remove     """Train and evaluate a model on CPU or GPU."""
 </s> add     """Train and evaluate a model with CPU or GPU.""" </s> remove         l_sum, start = 0.0, time.time()
 </s> add         l_sum, n, start = 0.0, 0, time.time() </s> remove         for t, (X, Y) in enumerate(data_iter):
 </s> add         for X, Y in data_iter: </s> remove     for epoch in range(1, num_epochs + 1):
        train_l_sum = 0
        train_acc_sum = 0
        start = time.time()
 </s> add     for epoch in range(num_epochs):
        train_l_sum, train_acc_sum, n, start = 0.0, 0.0, 0, time.time()
        data_iter_fn = gb.data_iter_random
                            lr, clipping_theta, batch_size, pred_period,
                            pred_len, prefixes):
      """Train an RNN model and predict the next item in the sequence."""
      if is_random_iter:
        data_iter_fn = gb.data_iter_random
      else:
          data_iter_fn = data_iter_consecutive
      params = get_params()
      loss = gloss.SoftmaxCrossEntropyLoss()
  
keep keep keep keep replace keep keep keep keep keep
 gb 0.8.9, fix acc, loss computations 
gluonbook/utils.py