Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/legacy_test/test_broadcast_to_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@


class TestBroadcastToError(unittest.TestCase):

def test_errors(self):
with paddle.static.program_guard(
paddle.static.Program(), paddle.static.Program()
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_calc_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def test2(self):


class TestGradientWithPrune(unittest.TestCase):

def test_prune(self):
with paddle.base.scope_guard(paddle.static.Scope()):
x = paddle.static.data(name='x', shape=[3], dtype='float32')
Expand Down
4 changes: 0 additions & 4 deletions test/legacy_test/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


class TestAPICase(unittest.TestCase):

def test_return_single_var(self):
def fn_1():
return paddle.tensor.fill_constant(
Expand Down Expand Up @@ -298,7 +297,6 @@ def fn_3():


class TestAPICase_Nested(unittest.TestCase):

def test_nested_case(self):
def fn_1(x=1):
var_5 = paddle.tensor.fill_constant(
Expand Down Expand Up @@ -513,7 +511,6 @@ def fn_3():


class TestAPICase_Error(unittest.TestCase):

def test_error(self):
def fn_1():
return paddle.tensor.fill_constant(
Expand Down Expand Up @@ -582,7 +579,6 @@ def type_error_default():

# when optimizer in case
class TestMultiTask(unittest.TestCase):

def test_optimizer_in_case(self):
BATCH_SIZE = 1
INPUT_SIZE = 784
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_cast_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ def test_grad(self):


class TestCastOpError(unittest.TestCase):

def test_errors(self):
paddle.enable_static()
with program_guard(Program(), Program()):
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_channel_shuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ def test_dygraph2(self):


class TestChannelShuffleError(unittest.TestCase):

def test_error_functional(self):
def error_input():
with paddle.base.dygraph.guard():
Expand Down
2 changes: 0 additions & 2 deletions test/legacy_test/test_clip_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ def initTestCase(self):


class TestClipOpError(unittest.TestCase):

def test_errors(self):
paddle.enable_static()
with paddle.static.program_guard(
Expand Down Expand Up @@ -489,7 +488,6 @@ def test_errors(self):


class TestClipOpFp16(unittest.TestCase):

def test_fp16(self):
if base.core.is_compiled_with_cuda():
paddle.enable_static()
Expand Down
4 changes: 0 additions & 4 deletions test/legacy_test/test_compare_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,6 @@ def test_check_output(self):


class TestCompareOpError(unittest.TestCase):

def test_int16_support(self):
paddle.enable_static()
with paddle.static.program_guard(
Expand All @@ -530,7 +529,6 @@ def test_int16_support(self):


class API_TestElementwise_Equal(unittest.TestCase):

def test_api(self):
paddle.enable_static()
with paddle.static.program_guard(
Expand Down Expand Up @@ -571,7 +569,6 @@ def test_api_fp16(self):


class API_TestElementwise_Greater_Than(unittest.TestCase):

def test_api_fp16(self):
paddle.enable_static()
with paddle.static.program_guard(
Expand All @@ -588,7 +585,6 @@ def test_api_fp16(self):


class TestCompareOpPlace(unittest.TestCase):

def test_place_1(self):
paddle.enable_static()
place = paddle.CPUPlace()
Expand Down
2 changes: 0 additions & 2 deletions test/legacy_test/test_concat_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,6 @@ def test_input_same_dtype():


class TestConcatAPI(unittest.TestCase):

def test_base_api(self):
paddle.enable_static()
with paddle.base.program_guard(paddle.base.Program()):
Expand Down Expand Up @@ -1014,7 +1013,6 @@ def if_enable_cinn(self):


class TestConcatOpErrorWithPir(unittest.TestCase):

def test_errors_with_pir(self):
paddle.enable_static()
with paddle.base.program_guard(
Expand Down
2 changes: 0 additions & 2 deletions test/legacy_test/test_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ def test_extremely_simple_net_with_op_in_condition(self):


class TestCondNestedControlFlow(unittest.TestCase):

def test_cond_inside_cond(self):
"""
pseudocode:
Expand Down Expand Up @@ -930,7 +929,6 @@ def func():


class TestCondWithDict(unittest.TestCase):

@compare_legacy_with_pt
def test_input_with_dict(self):
paddle.enable_static()
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_conj_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ def test_conj_api_real_number(self):


class Testfp16ConjOp(unittest.TestCase):

def testfp16(self):
if paddle.is_compiled_with_cuda():
input_x = (
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_conv2d_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,6 @@ def init_kernel_type(self):


class TestConv2DOpError(unittest.TestCase):

def test_errors(self):
with paddle.static.program_guard(
paddle.static.Program(), paddle.static.Program()
Expand Down
16 changes: 0 additions & 16 deletions test/legacy_test/test_conv_nn_grad.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@


class TestConvDoubleGradCheck(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
shape = [2, 4, 3, 3]
Expand All @@ -50,7 +49,6 @@ def test_grad(self):


class TestConvDoubleGradCheckTest0(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
shape = [2, 4, 3, 3]
Expand All @@ -74,7 +72,6 @@ def test_grad(self):


class TestConvDoubleGradCheckTest1(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
shape = [2, 3, 3, 3]
Expand All @@ -98,7 +95,6 @@ def test_grad(self):


class TestConv3DDoubleGradCheck(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
shape = [2, 4, 3, 4, 2]
Expand All @@ -122,7 +118,6 @@ def test_grad(self):


class TestConv3DDoubleGradCheckTest1(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
shape = [2, 4, 5, 3, 2]
Expand All @@ -146,7 +141,6 @@ def test_grad(self):


class TestConv2DoubleGradCheck_AsyPadding(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
shape = [2, 2, 3, 3]
Expand All @@ -170,7 +164,6 @@ def test_grad(self):


class TestConv2DoubleGradCheck_PaddingSAME(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
shape = [2, 2, 3, 3]
Expand All @@ -194,7 +187,6 @@ def test_grad(self):


class TestConv2DoubleGradCheck_PaddingVALID(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
shape = [2, 2, 3, 3]
Expand All @@ -218,7 +210,6 @@ def test_grad(self):


class TestConv2DoubleGradCheck_ChannelLast(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
x_shape = [2, 2, 3, 3]
Expand All @@ -243,7 +234,6 @@ def test_grad(self):


class TestConv2DoubleGradCheck_ChannelLast_AsyPadding(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
x_shape = [2, 2, 3, 3]
Expand All @@ -268,7 +258,6 @@ def test_grad(self):


class TestConv3DDoubleGradCheck_AsyPadding(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
shape = [2, 2, 2, 2, 2]
Expand All @@ -292,7 +281,6 @@ def test_grad(self):


class TestConv3DoubleGradCheck_PaddingSAME(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
shape = [2, 2, 2, 2, 2]
Expand All @@ -316,7 +304,6 @@ def test_grad(self):


class TestConv3DoubleGradCheck_PaddingVALID(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
shape = [2, 2, 3, 3, 2]
Expand All @@ -340,7 +327,6 @@ def test_grad(self):


class TestConv3DDoubleGradCheck_ChannelLast(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
x_shape = [2, 2, 2, 2, 3]
Expand All @@ -365,7 +351,6 @@ def test_grad(self):


class TestConv3DDoubleGradCheck_ChannelLast_AsyPadding(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
x_shape = [2, 2, 2, 2, 3]
Expand All @@ -390,7 +375,6 @@ def test_grad(self):


class TestDepthWiseConvDoubleGradCheck(unittest.TestCase):

@prog_scope()
def func_pir(self, place):
x_shape = [2, 4, 3, 3]
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_crop_tensor_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ def test_check_output(self):


class TestCropTensorException(unittest.TestCase):

def test_exception(self):
paddle.enable_static()
input1 = paddle.static.data(
Expand Down
2 changes: 0 additions & 2 deletions test/legacy_test/test_cumsum_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ def test_check_grad(self):


class BadInputTest(unittest.TestCase):

def test_error(self):
paddle.enable_static()
with paddle.static.program_guard(
Expand Down Expand Up @@ -725,7 +724,6 @@ def test_static(self):


class TestCumSumOpFp16(unittest.TestCase):

def test_fp16(self):
if core.is_compiled_with_cuda():
paddle.enable_static()
Expand Down
2 changes: 0 additions & 2 deletions test/legacy_test/test_deformable_conv_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ def init_test_case(self):


class TestModulatedDeformableConvInvalidInput(unittest.TestCase):

def test_error_api(self):
def test_invalid_input():
paddle.enable_static()
Expand Down Expand Up @@ -428,7 +427,6 @@ def test_invalid_groups():


class TestDeformConv2DAPI(unittest.TestCase):

def test_api(self):
def test_deform_conv2d_v1():
paddle.enable_static()
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_diag_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def init_shape(self):


class TestDiagEmbedAPICase(unittest.TestCase):

def test_case1(self):
paddle.enable_static()
main = paddle.static.Program()
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_diag_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def init_input_output(self):


class TestDiagV2Error(unittest.TestCase):

def test_errors(self):
paddle.enable_static()
main = static.Program()
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_diff_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ def set_args(self):


class TestDiffOpFp16(TestDiffOp):

def test_fp16_with_gpu(self):
paddle.enable_static()
if paddle.base.core.is_compiled_with_cuda():
Expand Down
2 changes: 0 additions & 2 deletions test/legacy_test/test_dlpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ def test_to_dlpack_from_zero_size(self):
class TestDLPackDevice(unittest.TestCase):
def test_dlpack_device(self):
with dygraph_guard():

tensor_cpu = paddle.to_tensor([1, 2, 3], place=base.CPUPlace())
device_type, device_id = tensor_cpu.__dlpack_device__()
self.assertEqual(device_type, DLDeviceType.kDLCPU)
Expand Down Expand Up @@ -362,7 +361,6 @@ def test_dlpack_device(self):

def test_dlpack_device_zero_dim(self):
with dygraph_guard():

tensor = paddle.to_tensor(5.0, place=base.CPUPlace())
device_type, device_id = tensor.__dlpack_device__()
self.assertEqual(device_type, DLDeviceType.kDLCPU)
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_dot_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ def test_check_grad_ignore_y(self):


class TestDotOpError(unittest.TestCase):

def test_errors(self):
with paddle.static.program_guard(
paddle.static.Program(), paddle.static.Program()
Expand Down