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)