Skip to content

Commit

Permalink
Fix tutorial broken by Docker build (apache#6694)
Browse files Browse the repository at this point in the history
  • Loading branch information
jroesch committed Oct 16, 2020
1 parent 08b08b1 commit 4c4d3dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tutorials/frontend/build_gcn.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

0 comments on commit 4c4d3dc

Please sign in to comment.