Skip to content

Commit

Permalink
fix black
Browse files Browse the repository at this point in the history
  • Loading branch information
yongwww committed Apr 27, 2023
1 parent b6ce182 commit e6fcc4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 5 additions & 1 deletion gallery/how_to/tune_with_autoscheduler/tune_sparse_x86.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def apply_func(search_policy, state, stage_id):
# After some measurement trials, we can load the best schedule from the log
# file and apply it.


def tune_and_evaluate(tune_option, search_policy):
# Run auto-tuning (search)
task.tune(tune_option, search_policy)
Expand Down Expand Up @@ -275,11 +276,14 @@ def tune_and_evaluate(tune_option, search_policy):
print(
"Execution time of this operator: %.3f ms"
% (
np.median(evaluator(X_tvm, W_data_tvm, W_indices_tvm, W_indptr_tvm, B_tvm, Y_tvm).results)
np.median(
evaluator(X_tvm, W_data_tvm, W_indices_tvm, W_indptr_tvm, B_tvm, Y_tvm).results
)
* 1000
)
)


# Notice: We do not run the tuning in our webpage server since it takes too long.
# Uncomment the following line to run it by yourself.
# tune_and_evaluate(tune_option, search_policy)
Expand Down
6 changes: 2 additions & 4 deletions gallery/how_to/work_with_relay/build_gcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def evaluate(g, logits):
dgl_g = dataset[0]
num_layers = 1
num_hidden = 16
features = dgl_g.ndata['feat']
features = dgl_g.ndata["feat"]
infeat_dim = features.shape[1]
num_classes = dataset.num_classes

Expand Down Expand Up @@ -232,9 +232,7 @@ def GraphConv(layer_name, input_dim, output_dim, adj, input, norm=None, bias=Tru

def prepare_params(g):
params = {}
params["infeats"] = g.ndata['feat'].numpy().astype(
"float32"
) # Only support float32 as feature for now
params["infeats"] = g.ndata["feat"].numpy().astype("float32")

# Generate adjacency matrix
nx_graph = dgl.to_networkx(g)
Expand Down

0 comments on commit e6fcc4e

Please sign in to comment.