Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZihengJiang committed Jan 17, 2019
1 parent bd4d035 commit c4b866a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/tvm/relay/build_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _bind_params_by_name(func, params):
return expr.bind(func, bind_dict)


def optimize(func, target, params=None):
def optimize(func, target=None, params=None):
"""Perform target invariant optimizations.
Parameters
Expand Down
3 changes: 2 additions & 1 deletion python/tvm/relay/quantize/quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,10 @@ def quantize(graph, params=None, dataset=None):
"FoldConstant",
"CanonicalizeOps"]
with _build.build_config(add_pass=opt_passes):
graph = _build.optimize(graph, params)
graph = _build.optimize(graph, params=params)

graph = annotate(graph)
graph = calibrate(graph, dataset)
graph = realize(graph)
graph = _ir_pass.fold_constant(graph)
return graph
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ def test_simulated_quantize():
out = relay.ir_pass.infer_type(out)
assert out.checked_type == out.args[0].checked_type
assert out.args[1].checked_type == relay.ty.TensorType(tuple(), "float32")
assert out.args[2].checked_type == relay.ty.TensorType(tuple(), "int32")
assert out.args[2].checked_type == relay.ty.TensorType(tuple(), "float32")
assert out.args[3].checked_type == relay.ty.TensorType(tuple(), "float32")
assert out.args[4].checked_type == relay.ty.TensorType(tuple(), "float32")


def test_quantize_pass():
Expand Down

0 comments on commit c4b866a

Please sign in to comment.