From 4c4d3dc2d8723a5b78d34f1bb0540ef66ee185a3 Mon Sep 17 00:00:00 2001 From: Jared Roesch Date: Thu, 15 Oct 2020 22:27:11 -0700 Subject: [PATCH] Fix tutorial broken by Docker build (#6694) --- tutorials/frontend/build_gcn.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tutorials/frontend/build_gcn.py b/tutorials/frontend/build_gcn.py index 5c571ef1ff25..b832d18f9c3a 100644 --- a/tutorials/frontend/build_gcn.py +++ b/tutorials/frontend/build_gcn.py @@ -242,7 +242,9 @@ def GraphConv(layer_name, input_dim, output_dim, adj, input, norm=None, bias=Tru def prepare_params(g, data): params = {} - params["infeats"] = data.features.astype("float32") # Only support float32 as feature for now + params["infeats"] = data.features.numpy().astype( + "float32" + ) # Only support float32 as feature for now # Generate adjacency matrix adjacency = nx.to_scipy_sparse_matrix(g) @@ -350,5 +352,7 @@ def prepare_params(g, data): acc = evaluate(data, logits_tvm) print("Test accuracy of TVM results: {:.2%}".format(acc)) +import tvm.testing + # Verify the results with the DGL model tvm.testing.assert_allclose(logits_torch, logits_tvm, atol=1e-3)