Skip to content

Commit 896a8c2

Browse files
committed
Resolve conflicts.
1 parent 9f491d3 commit 896a8c2

2 files changed

Lines changed: 20 additions & 12 deletions

File tree

backends/nxp/tests/ir/converter/node_converter/test_addmm_converter.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def assert_delegated(
3939
model,
4040
input_shape,
4141
mocker,
42+
request,
4243
use_qat=False,
4344
expected_delegated_ops: dict[Operator, int] | None = None,
4445
):
@@ -58,6 +59,7 @@ def assert_delegated(
5859
model,
5960
input_shape,
6061
graph_verifier,
62+
request,
6163
dataset_creator,
6264
use_qat=use_qat,
6365
)
@@ -80,9 +82,9 @@ def assert_not_delegated(self, model, input_shape):
8082
],
8183
ids=lambda s: f"input_shape = {s}",
8284
)
83-
def test__from_addmm(self, mocker, use_qat, input_shape: tuple[int, ...]):
85+
def test__from_addmm(self, mocker, request, use_qat, input_shape: tuple[int, ...]):
8486
model = AddmmModule(input_shape[-1])
85-
self.assert_delegated(model, input_shape, mocker, use_qat=use_qat)
87+
self.assert_delegated(model, input_shape, mocker, request, use_qat=use_qat)
8688

8789
def test__from_addmm__unsupported_alpha(self):
8890
input_shape = (1, 8)
@@ -99,20 +101,20 @@ def test__from_addmm__unsupported_beta(self):
99101
[1, 1.0],
100102
ids=lambda a: f"alpha = {a}",
101103
)
102-
def test__from_addmm__supported_alpha(self, mocker, use_qat, alpha):
104+
def test__from_addmm__supported_alpha(self, mocker, request, use_qat, alpha):
103105
input_shape = (1, 8)
104106
model = AddmmModule(input_shape[-1], alpha=alpha)
105-
self.assert_delegated(model, input_shape, mocker, use_qat)
107+
self.assert_delegated(model, input_shape, mocker, request, use_qat)
106108

107109
@pytest.mark.parametrize(
108110
"beta",
109111
[1, 1.0],
110112
ids=lambda b: f"beta = {b}",
111113
)
112-
def test__from_addmm__supported_beta(self, mocker, use_qat, beta):
114+
def test__from_addmm__supported_beta(self, mocker, request, use_qat, beta):
113115
input_shape = (1, 8)
114116
model = AddmmModule(input_shape[-1], beta=beta)
115-
self.assert_delegated(model, input_shape, mocker, use_qat)
117+
self.assert_delegated(model, input_shape, mocker, request, use_qat)
116118

117119
@pytest.mark.parametrize(
118120
"input_shape",
@@ -123,13 +125,14 @@ def test__from_addmm__supported_beta(self, mocker, use_qat, beta):
123125
ids=lambda s: f"input_shape = {s}",
124126
)
125127
def test__from_linear_with_bias__2d(
126-
self, mocker, use_qat, input_shape: tuple[int, ...]
128+
self, mocker, request, use_qat, input_shape: tuple[int, ...]
127129
):
128130
model = LinearModule(bias=True, in_features=input_shape[-1], out_features=7)
129131
self.assert_delegated(
130132
model,
131133
input_shape,
132134
mocker,
135+
request,
133136
use_qat=use_qat,
134137
expected_delegated_ops={AddMM: 1, PermuteCopy: 1},
135138
)
@@ -144,7 +147,7 @@ def test__from_linear_with_bias__2d(
144147
ids=lambda s: f"input_shape = {s}",
145148
)
146149
def test__from_linear_with_bias__higher_ranks(
147-
self, mocker, use_qat, input_shape: tuple[int, ...]
150+
self, mocker, request, use_qat, input_shape: tuple[int, ...]
148151
):
149152
# More than 2D cases get reshaped to 2D, so two extra view_copy nodes are delegated.
150153

@@ -153,6 +156,7 @@ def test__from_linear_with_bias__higher_ranks(
153156
model,
154157
input_shape,
155158
mocker,
159+
request,
156160
use_qat=use_qat,
157161
expected_delegated_ops={AddMM: 1, PermuteCopy: 1, ViewCopy: 2},
158162
)

backends/nxp/tests/ir/converter/node_converter/test_mm_converter.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def assert_delegated(
3131
model,
3232
input_shape,
3333
mocker,
34+
request,
3435
use_qat=False,
3536
expected_delegated_ops: dict[Operator, int] | None = None,
3637
):
@@ -50,6 +51,7 @@ def assert_delegated(
5051
model,
5152
input_shape,
5253
graph_verifier,
54+
request,
5355
dataset_creator,
5456
use_qat=use_qat,
5557
)
@@ -63,9 +65,9 @@ def assert_delegated(
6365
],
6466
ids=lambda s: f"input_shape = {s}",
6567
)
66-
def test__from_mm(self, mocker, use_qat, input_shape: tuple[int, ...]):
68+
def test__from_mm(self, mocker, request, use_qat, input_shape: tuple[int, ...]):
6769
model = MmModule(input_shape[-1])
68-
self.assert_delegated(model, input_shape, mocker, use_qat=use_qat)
70+
self.assert_delegated(model, input_shape, mocker, request, use_qat=use_qat)
6971

7072
@pytest.mark.parametrize(
7173
"input_shape",
@@ -76,13 +78,14 @@ def test__from_mm(self, mocker, use_qat, input_shape: tuple[int, ...]):
7678
ids=lambda s: f"input_shape = {s}",
7779
)
7880
def test__from_linear_without_bias(
79-
self, mocker, use_qat, input_shape: tuple[int, ...]
81+
self, mocker, request, use_qat, input_shape: tuple[int, ...]
8082
):
8183
model = LinearModule(bias=False, in_features=input_shape[-1], out_features=7)
8284
self.assert_delegated(
8385
model,
8486
input_shape,
8587
mocker,
88+
request,
8689
use_qat=use_qat,
8790
expected_delegated_ops={MM: 1, PermuteCopy: 1},
8891
)
@@ -97,7 +100,7 @@ def test__from_linear_without_bias(
97100
ids=lambda s: f"input_shape = {s}",
98101
)
99102
def test__from_linear_without_bias__higher_ranks(
100-
self, mocker, use_qat, input_shape: tuple[int, ...]
103+
self, mocker, request, use_qat, input_shape: tuple[int, ...]
101104
):
102105
# More than 2D cases get reshaped to 2D, so two extra view_copy nodes are delegated.
103106

@@ -106,6 +109,7 @@ def test__from_linear_without_bias__higher_ranks(
106109
model,
107110
input_shape,
108111
mocker,
112+
request,
109113
use_qat=use_qat,
110114
expected_delegated_ops={MM: 1, PermuteCopy: 1, ViewCopy: 2},
111115
)

0 commit comments

Comments
 (0)