diff --git a/python/paddle/fluid/tests/unittests/ipu/test_pool_max_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_pool_max_op_ipu.py index fffac1218576bf747548be6016e2bdb340e82b30..a7c45c6686f10e3c13462d49ab8e34fe72c4f03a 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_pool_max_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_pool_max_op_ipu.py @@ -87,8 +87,8 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_pow_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_pow_op_ipu.py index 8ede44d7f92297745bd4c621adcf0d3846afff59..5059de7ba77b1baf65c511da11735a73a87aa1e8 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_pow_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_pow_op_ipu.py @@ -78,8 +78,8 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) @@ -141,8 +141,8 @@ class TestCase1(TestBase): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_reduce_x_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_reduce_x_op_ipu.py index f8c96684afe8f3c8222fcc4ec6f9c179a73158fd..ac8ad08e8b28c00555c5c78f5b8a834b0024acc7 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_reduce_x_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_reduce_x_op_ipu.py @@ -71,8 +71,8 @@ class TestMean(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_reshape_inplace_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_reshape_inplace_op_ipu.py index a6e0552691b857c6f53bf8dc327c0e874bab8708..f312b7b69ad79b721fd768f6762a48ca68793d6d 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_reshape_inplace_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_reshape_inplace_op_ipu.py @@ -82,8 +82,8 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_reshape_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_reshape_op_ipu.py index 2cc0d1770be13cea265d521c20dc4dabe186dbd5..5163838bc0cd633f69e2e446294250686e4fe04f 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_reshape_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_reshape_op_ipu.py @@ -76,8 +76,8 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_save_load.py b/python/paddle/fluid/tests/unittests/ipu/test_save_load.py index 5d9ff4eb886c02a551bdc6ef9ffc2c2e653b999a..24bb8e111842cb93ed35cdc796868c5a911ee36f 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_save_load.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_save_load.py @@ -93,8 +93,9 @@ class TestBase(IPUOpTest): if not save_otherwise_load: paddle.static.load(main_prog, "model/model") - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.attrs['is_training'] + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig( + is_training=self.attrs['is_training']) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile( self.feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_scale_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_scale_op_ipu.py index 94758155b35a82d3971f6f25192eb5516276e7ed..6ad2a89a738b7090ce082a637c3d531cf4566f9a 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_scale_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_scale_op_ipu.py @@ -82,8 +82,8 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) @@ -175,8 +175,8 @@ class TestCase4(TestBase): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_set_batch_size_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_set_batch_size_ipu.py index 335e90b4607b2fe84b2c37b2a1bae75fca2a0044..93945b98ef0a26b35b28e1cf9d2bb5e88d21f308 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_set_batch_size_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_set_batch_size_ipu.py @@ -81,10 +81,9 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training - # set batch size - ipu_strategy.batch_size = 2 + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig( + batch_size=2, is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_sgd_optimizer.py b/python/paddle/fluid/tests/unittests/ipu/test_sgd_optimizer.py index ee469c5fc1de992dc24626116c1d9ed06410690f..df0e2a040bd3e55aac20e383c7aa2ff50c567de4 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_sgd_optimizer.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_sgd_optimizer.py @@ -59,8 +59,8 @@ class TestSGD(unittest.TestCase): if run_ipu: feed_list = [image.name] fetch_list = [loss.name] - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = True + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=True) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_slice_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_slice_op_ipu.py index 7261f26c0ec108a50514e0361d28f5de274f1176..3bdfeabce6592cd25067adfdabe8b7c74a6848c7 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_slice_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_slice_op_ipu.py @@ -80,8 +80,8 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) @@ -159,8 +159,8 @@ class TestCase2(TestBase): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_softmax_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_softmax_op_ipu.py index 36cb529c231a0fe9c875fa7f2d4827c63d5ca447..a4a4b83baf35e558ff1f8b0982ffc44287919dfc 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_softmax_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_softmax_op_ipu.py @@ -77,8 +77,8 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_squeeze_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_squeeze_op_ipu.py index 672e6ede0ede10c490edbb7c41fafb05fdae235d..ccd2796590838faa8980ef7d214f73a944c9220d 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_squeeze_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_squeeze_op_ipu.py @@ -77,11 +77,11 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, - ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) + iipu_strategy=ipu_strategy).compile(feed_list, fetch_list) else: program = main_prog diff --git a/python/paddle/fluid/tests/unittests/ipu/test_stack_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_stack_op_ipu.py index 360e81f2862cddce6d54a4d2fb6f5cda631d7ae7..3d5de11b5e213e3fe68561d60c1c0dbcb6fbcbf1 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_stack_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_stack_op_ipu.py @@ -88,8 +88,8 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_sum_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_sum_op_ipu.py index 6bba02942a713daf5be6faa0344e355e2f211f8d..003350cd7a01e284d28ff8904a38ab3755e07642 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_sum_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_sum_op_ipu.py @@ -83,8 +83,8 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) @@ -149,11 +149,11 @@ class TestCase1(TestBase): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, - ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) + iipu_strategy=ipu_strategy).compile(feed_list, fetch_list) else: program = main_prog diff --git a/python/paddle/fluid/tests/unittests/ipu/test_topk_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_topk_op_ipu.py index 4cbbc9e478d2e8b3719c01562e57780cede1049b..9915a7a1fd89f91f71814ebbe577abcf9327cb37 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_topk_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_topk_op_ipu.py @@ -102,8 +102,8 @@ class TestTopKOp(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_transpose_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_transpose_op_ipu.py index 715f81b684e35b1aad955883f1198696e42d4c04..77d2f4131014965ef6cfba9cdf5efffa34c2dbc6 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_transpose_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_transpose_op_ipu.py @@ -78,8 +78,8 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_unsqueeze_op_ipu.py b/python/paddle/fluid/tests/unittests/ipu/test_unsqueeze_op_ipu.py index 9d8cab6a697081d86635fd25eeb4c1c0e9f82fce..75ed5a07315c775e4ea3e105a1fa4d6731666c70 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_unsqueeze_op_ipu.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_unsqueeze_op_ipu.py @@ -76,8 +76,8 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) diff --git a/python/paddle/fluid/tests/unittests/ipu/test_varname_inplace.py b/python/paddle/fluid/tests/unittests/ipu/test_varname_inplace.py index 801794804da0a5e3df210decbfd20bbca6f450c7..fabad936decb975214f0416000d77c76a2f7ddfb 100644 --- a/python/paddle/fluid/tests/unittests/ipu/test_varname_inplace.py +++ b/python/paddle/fluid/tests/unittests/ipu/test_varname_inplace.py @@ -91,8 +91,8 @@ class TestBase(IPUOpTest): if run_ipu: feed_list = self.feed_list - ipu_strategy = compiler.get_ipu_strategy() - ipu_strategy.is_training = self.is_training + ipu_strategy = paddle.static.IpuStrategy() + ipu_strategy.SetGraphConfig(is_training=self.is_training) program = compiler.IPUCompiledProgram( main_prog, ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)