Skip to content

Commit eaca5d5

Browse files
committed
lint code
1 parent 8d21064 commit eaca5d5

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

tests/python/driver/tvmc/test_transform.py

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ def test_layout_transform_convert_kernel_layout_pass_args(relay_conv2d, monkeypa
8787
monkeypatch.setattr(relay.transform, "ConvertLayout", mock_convert_layout)
8888

8989
with tvm.transform.PassContext(opt_level=3):
90-
apply_graph_transforms(relay_conv2d, {"desired_layout": [desired_layout], "desired_layout_ops": desired_layout_ops})
90+
apply_graph_transforms(
91+
relay_conv2d,
92+
{"desired_layout": [desired_layout], "desired_layout_ops": desired_layout_ops},
93+
)
9194

9295
mock_convert_layout.assert_called_once_with(
9396
{
@@ -109,7 +112,10 @@ def test_layout_transform_convert_layout_pass_args_multiple(relay_conv2d, monkey
109112
monkeypatch.setattr(relay.transform, "ConvertLayout", mock_convert_layout)
110113

111114
with tvm.transform.PassContext(opt_level=3):
112-
apply_graph_transforms(relay_conv2d, {"desired_layout": desired_layout, "desired_layout_ops": desired_layout_ops})
115+
apply_graph_transforms(
116+
relay_conv2d,
117+
{"desired_layout": desired_layout, "desired_layout_ops": desired_layout_ops},
118+
)
113119

114120
mock_convert_layout.assert_called_once_with(
115121
{
@@ -119,13 +125,20 @@ def test_layout_transform_convert_layout_pass_args_multiple(relay_conv2d, monkey
119125
)
120126

121127

122-
@pytest.mark.parametrize("desired", [
123-
(["NHWC", "NCHW"], ["nn.max_pool2d"]),
124-
(["NHWC", "NCHW"], None),
125-
])
126-
def test_layout_transform_convert_layout_pass_args_multiple_invalid(relay_conv2d, monkeypatch, desired):
128+
@pytest.mark.parametrize(
129+
"desired",
130+
[
131+
(["NHWC", "NCHW"], ["nn.max_pool2d"]),
132+
(["NHWC", "NCHW"], None),
133+
],
134+
)
135+
def test_layout_transform_convert_layout_pass_args_multiple_invalid(
136+
relay_conv2d,
137+
monkeypatch,
138+
desired,
139+
):
127140
"""
128-
TODO
141+
Check invalid cases when passing multiple values to the desired layouts argument.
129142
"""
130143
desired_layout, desired_layout_ops = desired
131144

@@ -135,7 +148,10 @@ def test_layout_transform_convert_layout_pass_args_multiple_invalid(relay_conv2d
135148

136149
with pytest.raises(TVMCException):
137150
with tvm.transform.PassContext(opt_level=3):
138-
apply_graph_transforms(relay_conv2d, {"desired_layout": desired_layout, "desired_layout_ops": desired_layout_ops})
151+
apply_graph_transforms(
152+
relay_conv2d,
153+
{"desired_layout": desired_layout, "desired_layout_ops": desired_layout_ops},
154+
)
139155

140156

141157
def test_layout_transform_to_mixed_precision_pass_args_mock(relay_conv2d, monkeypatch):

0 commit comments

Comments
 (0)