Skip to content

Commit c4a483f

Browse files
committed
[API-Compat] Removed unittest that paddle.split will also fail
1 parent 546cfca commit c4a483f

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

test/legacy_test/test_compat_split_static.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -138,43 +138,6 @@ def test_static_graph(self):
138138

139139
paddle.disable_static()
140140

141-
def test_static_graph_2(self):
142-
"""Test static graph execution"""
143-
np.random.seed(114514)
144-
axis = paddle.to_tensor(-1)
145-
paddle.enable_static()
146-
with paddle.static.program_guard(paddle.static.Program()):
147-
x = paddle.static.data(name='x', shape=[None, 9], dtype='float32')
148-
result0, result1, result2 = split(x, 4, dim=axis)
149-
output = result0 + result1 * result2
150-
151-
place = (
152-
paddle.CUDAPlace(0)
153-
if paddle.is_compiled_with_cuda()
154-
else paddle.CPUPlace()
155-
)
156-
exe = paddle.static.Executor(place)
157-
158-
input_data = np.random.rand(3, 9).astype('float32')
159-
feed = {'x': input_data}
160-
161-
results = exe.run(
162-
feed=feed, fetch_list=[result0, result1, result2, output]
163-
)
164-
165-
np.testing.assert_allclose(results[0], input_data[:, 0:4])
166-
np.testing.assert_allclose(results[1], input_data[:, 4:8])
167-
np.testing.assert_allclose(results[2], input_data[:, 8:9])
168-
169-
expected_output = (
170-
input_data[:, 0:4] + input_data[:, 4:8] * input_data[:, -1:]
171-
)
172-
np.testing.assert_allclose(
173-
expected_output, results[3], rtol=1e-4, atol=1e-4
174-
)
175-
176-
paddle.disable_static()
177-
178141
def test_error_hint(self):
179142
"""Test whether there will be correct exception when users pass paddle.split kwargs in paddle.compat.split, vice versa."""
180143

0 commit comments

Comments
 (0)