Skip to content

Commit

Permalink
unit tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
d-smirnov committed Oct 28, 2020
1 parent 5d62080 commit 45b4766
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
28 changes: 14 additions & 14 deletions tests/python/relay/test_pass_annotate_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def test_extern_dnnl_mobilenet():

def test_multiple_ends():
@tvm.ir.register_op_attr("nn.relu", "target.test")
def relu(attrs, args): # pylint: disable=unused-variable
def relu(expr): # pylint: disable=unused-variable
return True

def before():
Expand Down Expand Up @@ -221,8 +221,8 @@ def test_type_propagation():
target = "test_type_propagation"

@tvm.ir.register_op_attr("nn.relu", "target." + target)
def relu(attrs, args): # pylint: disable=unused-variable
return args[0].checked_type.dtype == "float32"
def relu(expr): # pylint: disable=unused-variable
return expr.args[0].checked_type.dtype == "float32"

def before():
x = relay.var("x", shape=(10, 10))
Expand All @@ -240,11 +240,11 @@ def test_tuple():
target = "test_tuple"

@tvm.ir.register_op_attr("nn.relu", "target." + target)
def relu(attrs, args): # pylint: disable=unused-variable
def relu(expr): # pylint: disable=unused-variable
return True

@tvm.ir.register_op_attr("concatenate", "target." + target)
def concatenate(attrs, args): # pylint: disable=unused-variable
def concatenate(expr): # pylint: disable=unused-variable
return True

"""Test that TupleNode is included in annotation when surrounded by supported nodes."""
Expand Down Expand Up @@ -331,11 +331,11 @@ def after():

def test_multiple_runs():
@tvm.ir.register_op_attr("nn.relu", "target.A")
def relu(attrs, args): # pylint: disable=unused-variable
def relu(expr): # pylint: disable=unused-variable
return True

@tvm.ir.register_op_attr("add", "target.B")
def add(attrs, args): # pylint: disable=unused-variable
def add(expr): # pylint: disable=unused-variable
return True

def before():
Expand All @@ -359,19 +359,19 @@ def test_if_else():
target = "test_if_else"

@tvm.ir.register_op_attr("equal", "target." + target)
def relu(attrs, args): # pylint: disable=unused-variable
def relu(expr): # pylint: disable=unused-variable
return True

@tvm.ir.register_op_attr("tanh", "target." + target)
def tanh(attrs, args): # pylint: disable=unused-variable
def tanh(expr): # pylint: disable=unused-variable
return True

@tvm.ir.register_op_attr("sigmoid", "target." + target)
def sigmoid(attrs, args): # pylint: disable=unused-variable
def sigmoid(expr): # pylint: disable=unused-variable
return True

@tvm.ir.register_op_attr("erf", "target." + target)
def erf(attrs, args): # pylint: disable=unused-variable
def erf(expr): # pylint: disable=unused-variable
return True

"""Test that If-else nodes compiles correctly when surrounded by supported nodes."""
Expand Down Expand Up @@ -430,15 +430,15 @@ def test_while_let():
target = "test_while_let"

@tvm.ir.register_op_attr("less", "target." + target)
def less(attrs, args): # pylint: disable=unused-variable
def less(expr): # pylint: disable=unused-variable
return True

@tvm.ir.register_op_attr("add", "target." + target)
def add(attrs, args): # pylint: disable=unused-variable
def add(expr): # pylint: disable=unused-variable
return True

@tvm.ir.register_op_attr("zeros_like", "target." + target)
def zeros_like(attrs, args): # pylint: disable=unused-variable
def zeros_like(expr): # pylint: disable=unused-variable
return True

"""Test that let nodes compiles correctly when surrounded by other nodes."""
Expand Down
12 changes: 6 additions & 6 deletions tests/python/relay/test_pass_partition_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ def test_duplicate_outputs():
target = "test_duplicate_outputs"

@tvm.ir.register_op_attr("abs", "target." + target)
def abs(attrs, args): # pylint: disable=unused-variable
def abs(expr): # pylint: disable=unused-variable
return True

def create_graph():
Expand Down Expand Up @@ -1096,11 +1096,11 @@ def test_duplicate_merge_and_tuplegetitem():
target = "test_duplicate_merge_and_tuplegetitem"

@tvm.ir.register_op_attr("nn.batch_norm", "target." + target)
def batch_norm(attrs, args): # pylint: disable=unused-variable
def batch_norm(expr): # pylint: disable=unused-variable
return True

@tvm.ir.register_op_attr("nn.relu", "target." + target)
def relu(attrs, args): # pylint: disable=unused-variable
def relu(expr): # pylint: disable=unused-variable
return True

def create_graph():
Expand Down Expand Up @@ -1177,7 +1177,7 @@ def expected():

def test_constant_tuples():
@tvm.ir.register_op_attr("qnn.concatenate", "target.const_tuples")
def add(attrs, args): # pylint: disable=unused-variable
def add(expr): # pylint: disable=unused-variable
return True

def create_graph():
Expand Down Expand Up @@ -1223,11 +1223,11 @@ def test_flatten_tuple_output():
target = "test_flatten_tuple_output"

@tvm.ir.register_op_attr("split", "target." + target)
def split(attrs, args): # pylint: disable=unused-variable
def split(expr): # pylint: disable=unused-variable
return True

@tvm.ir.register_op_attr("abs", "target." + target)
def abs(attrs, args): # pylint: disable=unused-variable
def abs(expr): # pylint: disable=unused-variable
return True

def create_graph():
Expand Down

0 comments on commit 45b4766

Please sign in to comment.