Skip to content

Commit d7457e5

Browse files
committed
update xpu test
1 parent c57fba8 commit d7457e5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/xpu/test_pad_op_xpu.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ def init_test_case(self):
7171

7272
def init_data(self):
7373
self.inputs = {'X': np.random.random(self.shape).astype(self.dtype)}
74+
self.attrs = {
75+
'paddings': list(np.array(self.paddings).flatten()),
76+
'pad_value': self.pad_value,
77+
'pad_from_first_axis': self.pad_from_first_axis,
78+
}
7479
if not (
7580
len(self.paddings) == len(self.shape)
7681
and self.pad_from_first_axis
@@ -87,11 +92,6 @@ def init_data(self):
8792
constant_values=self.pad_value,
8893
)
8994
}
90-
self.attrs = {
91-
'paddings': list(np.array(self.paddings).flatten()),
92-
'pad_value': self.pad_value,
93-
'pad_from_first_axis': self.pad_from_first_axis,
94-
}
9595

9696
def test_check_output(self):
9797
self.check_output_with_place(self.place)

0 commit comments

Comments
 (0)