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 authored and trevor-m committed Dec 4, 2020
1 parent 733dff8 commit c9b3074
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tutorials/frontend/build_gcn.py
Original file line number Diff line number Diff line change
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 c9b3074

Please sign in to comment.