From 095220467021496318496157da88634d260a356d Mon Sep 17 00:00:00 2001 From: Matthew Kleinsmith Date: Fri, 31 Mar 2017 02:23:48 -0700 Subject: [PATCH] Replace .next() with next() for py3 compatibility --- 1_linear_regression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1_linear_regression.py b/1_linear_regression.py index 40ec737..9c3dc59 100644 --- a/1_linear_regression.py +++ b/1_linear_regression.py @@ -47,7 +47,7 @@ def main(): cost += train(model, loss, optimizer, X[start:end], Y[start:end]) print("Epoch = %d, cost = %s" % (i + 1, cost / num_batches)) - w = model.parameters().next().data # model has only one parameter + w = next(model.parameters()).data # model has only one parameter print("w = %.2f" % w.numpy()) # will be approximately 2 if __name__ == "__main__":