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_scale_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def test_scale_selected_rows_inplace(self):


class TestScaleRaiseError(unittest.TestCase):

def test_errors(self):
paddle.enable_static()

Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_searchsorted_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ def test_out_int32(self):


class TestSearchSortedError(unittest.TestCase):

def test_error_api(self):
paddle.enable_static()

Expand Down
2 changes: 0 additions & 2 deletions test/legacy_test/test_stack_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ def test_case(self):


class API_test(unittest.TestCase):

def test_out(self):
with paddle.static.program_guard(
paddle.static.Program(), paddle.static.Program()
Expand Down Expand Up @@ -336,7 +335,6 @@ def test_single_tensor_error(self):


class TestStackOpWithNegativeShape(unittest.TestCase):

def test_out(self):
main_prg, startup_prg = paddle.static.Program(), paddle.static.Program()
with paddle.static.program_guard(main_prg, startup_prg):
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_static_save_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,6 @@ def set_var(var, ndarray):


class TestStaticSaveLoadPickle(unittest.TestCase):

def test_pickle_protocol(self):
# enable static graph mode
paddle.enable_static()
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_static_save_load_large.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@


class TestStaticSaveLoadLargeParameters(unittest.TestCase):

def test_large_parameters_static_save(self):
# enable static graph mode
paddle.enable_static()
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_std_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def test_error(self):


class Testfp16Std(unittest.TestCase):

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_stride.py
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,6 @@ def test_stride_gpu(self):


class TestToStaticCheck(unittest.TestCase):

def test_error(self):
@paddle.jit.to_static(full_graph=True)
def func1():
Expand Down Expand Up @@ -1070,7 +1069,6 @@ def func2():
func2()

def test_no_error(self):

@paddle.jit.to_static(full_graph=True)
def func1():
x_np = np.random.random(size=[2, 3, 4]).astype('float32')
Expand Down
3 changes: 0 additions & 3 deletions test/legacy_test/test_sum_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ def test_static(self):


class API_Test_Add_n(unittest.TestCase):

def test_api(self):
with base.program_guard(base.Program(), base.Program()):
input0 = paddle.tensor.fill_constant(
Expand Down Expand Up @@ -502,7 +501,6 @@ def test_add_n_and_add_and_grad(self):


class TestRaiseSumError(unittest.TestCase):

def test_errors(self):
with paddle.static.program_guard(
paddle.static.Program(), paddle.static.Program()
Expand Down Expand Up @@ -534,7 +532,6 @@ def test_dtype1():


class TestRaiseSumsError(unittest.TestCase):

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


class TestAPISwitchCase(unittest.TestCase):

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


class TestAPISwitchCase_Nested(unittest.TestCase):

def test_nested_switch_case(self):
def fn_1(x=1):
out = paddle.static.nn.switch_case(
Expand Down Expand Up @@ -580,7 +578,6 @@ def fn_3():

# test TypeError and ValueError of api switch_case
class TestAPISwitchCase_Error(unittest.TestCase):

def test_error(self):
def fn_1():
return paddle.tensor.fill_constant(
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_take_along_axis_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ def test_error(self):
class TestTakeAlongAxisAPICase4(unittest.TestCase):
def test_static_shape_take_along_axis(self):
with dygraph_guard():

x = paddle.randn([4, 2])
ind = paddle.to_tensor([[0, 1]])

Expand Down
2 changes: 0 additions & 2 deletions test/legacy_test/test_tensor_type_convert_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ def test_pir_all_dtype_conversions(self):
method_name,
target_dtype,
) in self._supported_dtype_conversions.items():

if target_dtype == 'bfloat16':
continue
for init_dtype in self._total_init_dtype:
Expand All @@ -216,7 +215,6 @@ def test_pir_all_dtype_conversions(self):
def _pir_single_dtype_conversion(
self, method_name, init_dtype, target_dtype
):

# Create static graph input
x = paddle.static.data(name="x", shape=self.shape, dtype=init_dtype)
# Check if the method exists
Expand Down
3 changes: 0 additions & 3 deletions test/legacy_test/test_tile_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ def test_check_output(self):


class TestTileError(unittest.TestCase):

def test_errors(self):
with paddle.static.program_guard(
paddle.static.Program(), paddle.static.Program()
Expand All @@ -454,7 +453,6 @@ def test_errors(self):


class TestTileAPIStatic(unittest.TestCase):

def test_api(self):
with paddle.static.program_guard(
paddle.static.Program(), paddle.static.Program()
Expand Down Expand Up @@ -616,7 +614,6 @@ def test_dygraph(self):


class Testfp16TileOp(unittest.TestCase):

def testfp16(self):
if not paddle.is_compiled_with_cuda():
return
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_trace_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ def init_config(self):


class TestTraceAPICase(unittest.TestCase):

def test_case1(self):
with paddle.static.program_guard(paddle.static.Program()):
case = np.random.randn(2, 20, 2, 3).astype('float32')
Expand Down
4 changes: 0 additions & 4 deletions test/legacy_test/test_transpose_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ def initTestCase(self):


class TestTransposeOpError(unittest.TestCase):

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


class TestTransposeApi(unittest.TestCase):

def test_static_out(self):
paddle.enable_static()
with paddle.static.program_guard(paddle.static.Program()):
Expand Down Expand Up @@ -572,7 +570,6 @@ def test_dygraph_out(self):


class TestTAPI(unittest.TestCase):

def test_static_out(self):
with base.program_guard(base.Program()):
data = paddle.static.data(shape=[10], dtype="float64", name="data")
Expand Down Expand Up @@ -644,7 +641,6 @@ def test_x_dimension_check():


class TestMoveAxis(unittest.TestCase):

def test_static_moveaxis1(self):
x_np = np.random.randn(2, 3, 4, 5, 7)
expected = np.moveaxis(x_np, [0, 4, 3, 2], [1, 3, 2, 0])
Expand Down
2 changes: 0 additions & 2 deletions test/legacy_test/test_tril_indices_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def init_config(self):


class TestTrilIndicesAPICaseStatic(unittest.TestCase):

def test_static(self):
places = (
[paddle.CPUPlace(), paddle.base.CUDAPlace(0)]
Expand Down Expand Up @@ -110,7 +109,6 @@ def test_num_offset_type_check():


class TestTrilIndicesAPICaseDefault(unittest.TestCase):

def test_default_CPU(self):
paddle.enable_static()
with paddle.static.program_guard(
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_triplet_margin_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ def calc_triplet_margin_loss(


class TestTripletMarginLoss(unittest.TestCase):

def test_TripletMarginLoss(self):
shape = (2, 2)
input = np.random.uniform(0.1, 0.8, size=shape).astype(np.float64)
Expand Down
3 changes: 0 additions & 3 deletions test/legacy_test/test_triplet_margin_with_distance_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ def calc_triplet_margin_distance_loss(


class TestTripletMarginWithDistanceLossnew(unittest.TestCase):

def test_TripletMarginDistanceLoss(self):
shape = (5, 5)
np.random.seed(1234)
Expand Down Expand Up @@ -286,7 +285,6 @@ def test_TripletMarginDistanceLoss_error(self):


class TestTripletMarginWithDistanceLossDF(unittest.TestCase):

def test_TripletMarginDistanceLoss_distance_function(self):
def distance_function_1(x1, x2):
return 1.0 - paddle.nn.functional.cosine_similarity(x1, x2)
Expand Down Expand Up @@ -400,7 +398,6 @@ def test_TripletMarginDistanceLoss_dimension(self):


class TestTripletMarginWithDistanceLossSwap(unittest.TestCase):

def test_TripletMarginWithDistanceLoss_swap(self):
reduction = 'mean'
place = paddle.CPUPlace()
Expand Down
2 changes: 0 additions & 2 deletions test/legacy_test/test_triu_indices_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def init_config(self):


class TestTriuIndicesAPICaseStatic(unittest.TestCase):

def test_static(self):
if base.core.is_compiled_with_cuda():
place = paddle.base.CUDAPlace(0)
Expand Down Expand Up @@ -105,7 +104,6 @@ def test_num_offset_type_check():


class TestTriuIndicesAPICaseDefault(unittest.TestCase):

def test_default_CPU(self):
paddle.enable_static()
with paddle.static.program_guard(
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_unflatten.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ def test_static_or_pir_mode():


class TestLayerName(unittest.TestCase):

def test_name(self):
self.x = np.random.randn(3, 4, 4, 5).astype('float32')
self.axis = 1
Expand Down
1 change: 0 additions & 1 deletion test/legacy_test/test_uniform_random_bf16_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ def check_with_place(self, place):


class TestUniformRandomOpAPISeed(unittest.TestCase):

def test_attr_tensor_API(self):
_seed = 10
gen = paddle.seed(_seed)
Expand Down
Loading