                num_epochs):
      """Train and evaluate a model on CPU or GPU."""
      print('training on', ctx)
      loss = gloss.SoftmaxCrossEntropyLoss()
      for epoch in range(1, num_epochs + 1):
          train_l_sum = 0
          train_acc_sum = 0
          start = time.time()
          for X, y in train_iter:
              X, y = X.as_in_context(ctx), y.as_in_context(ctx)
              with autograd.record():
                  y_hat = net(X)
                  l = loss(y_hat, y)
 
</s> remove     """Train and evaluate a model on CPU or GPU."""
 </s> add     """Train and evaluate a model with CPU or GPU.""" </s> remove     """Train and evaluate a model on CPU."""
    for epoch in range(1, num_epochs + 1):
        train_l_sum = 0
        train_acc_sum = 0
 </s> add     """Train and evaluate a model with CPU."""
    for epoch in range(num_epochs):
        train_l_sum, train_acc_sum, n = 0.0, 0.0, 0 </s> remove                 l = loss(y_hat, y)
 </s> add                 l = loss(y_hat, y).sum() </s> remove                 l = loss(y_hat, y)
 </s> add                 l = loss(y_hat, y).sum() </s> remove     for epoch in range(1, num_epochs + 1):
        train_l_sum, train_acc_sum, n, m = 0.0, 0.0, 0.0, 0.0
        start = time.time()
 </s> add     for epoch in range(num_epochs):
        train_l_sum, train_acc_sum, n, m, start = 0.0, 0.0, 0, 0, time.time()
    for epoch in range(num_epochs):
        train_l_sum, train_acc_sum, n, start = 0.0, 0.0, 0, time.time()
                num_epochs):
      """Train and evaluate a model on CPU or GPU."""
      print('training on', ctx)
      loss = gloss.SoftmaxCrossEntropyLoss()
    for epoch in range(num_epochs):
        train_l_sum, train_acc_sum, n, start = 0.0, 0.0, 0, time.time()
    for epoch in range(num_epochs):
        train_l_sum, train_acc_sum, n, start = 0.0, 0.0, 0, time.time()
    for epoch in range(num_epochs):
        train_l_sum, train_acc_sum, n, start = 0.0, 0.0, 0, time.time()
    for epoch in range(num_epochs):
        train_l_sum, train_acc_sum, n, start = 0.0, 0.0, 0, time.time()
          for X, y in train_iter:
              X, y = X.as_in_context(ctx), y.as_in_context(ctx)
              with autograd.record():
                  y_hat = net(X)
                  l = loss(y_hat, y)
keep keep keep keep replace replace replace replace keep keep keep keep keep
 gb 0.8.9, fix acc, loss computations 
gluonbook/utils.py