未验证 提交 eb45bb4e 编写于 作者: Y yaozhixin 提交者: GitHub

update uts p3 (#39214)

上级 33b3e28a
...@@ -87,8 +87,8 @@ class TestBase(IPUOpTest): ...@@ -87,8 +87,8 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
...@@ -78,8 +78,8 @@ class TestBase(IPUOpTest): ...@@ -78,8 +78,8 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
...@@ -141,8 +141,8 @@ class TestCase1(TestBase): ...@@ -141,8 +141,8 @@ class TestCase1(TestBase):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
...@@ -71,8 +71,8 @@ class TestMean(IPUOpTest): ...@@ -71,8 +71,8 @@ class TestMean(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
...@@ -82,8 +82,8 @@ class TestBase(IPUOpTest): ...@@ -82,8 +82,8 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
...@@ -76,8 +76,8 @@ class TestBase(IPUOpTest): ...@@ -76,8 +76,8 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
...@@ -93,8 +93,9 @@ class TestBase(IPUOpTest): ...@@ -93,8 +93,9 @@ class TestBase(IPUOpTest):
if not save_otherwise_load: if not save_otherwise_load:
paddle.static.load(main_prog, "model/model") paddle.static.load(main_prog, "model/model")
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.attrs['is_training'] ipu_strategy.SetGraphConfig(
is_training=self.attrs['is_training'])
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, ipu_strategy=ipu_strategy).compile( main_prog, ipu_strategy=ipu_strategy).compile(
self.feed_list, fetch_list) self.feed_list, fetch_list)
......
...@@ -82,8 +82,8 @@ class TestBase(IPUOpTest): ...@@ -82,8 +82,8 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
...@@ -175,8 +175,8 @@ class TestCase4(TestBase): ...@@ -175,8 +175,8 @@ class TestCase4(TestBase):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
...@@ -81,10 +81,9 @@ class TestBase(IPUOpTest): ...@@ -81,10 +81,9 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(
# set batch size batch_size=2, is_training=self.is_training)
ipu_strategy.batch_size = 2
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
...@@ -59,8 +59,8 @@ class TestSGD(unittest.TestCase): ...@@ -59,8 +59,8 @@ class TestSGD(unittest.TestCase):
if run_ipu: if run_ipu:
feed_list = [image.name] feed_list = [image.name]
fetch_list = [loss.name] fetch_list = [loss.name]
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = True ipu_strategy.SetGraphConfig(is_training=True)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, ipu_strategy=ipu_strategy).compile(feed_list, main_prog, ipu_strategy=ipu_strategy).compile(feed_list,
fetch_list) fetch_list)
......
...@@ -80,8 +80,8 @@ class TestBase(IPUOpTest): ...@@ -80,8 +80,8 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
...@@ -159,8 +159,8 @@ class TestCase2(TestBase): ...@@ -159,8 +159,8 @@ class TestCase2(TestBase):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
...@@ -77,8 +77,8 @@ class TestBase(IPUOpTest): ...@@ -77,8 +77,8 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
...@@ -77,11 +77,11 @@ class TestBase(IPUOpTest): ...@@ -77,11 +77,11 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) iipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
else: else:
program = main_prog program = main_prog
......
...@@ -88,8 +88,8 @@ class TestBase(IPUOpTest): ...@@ -88,8 +88,8 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
...@@ -83,8 +83,8 @@ class TestBase(IPUOpTest): ...@@ -83,8 +83,8 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
...@@ -149,11 +149,11 @@ class TestCase1(TestBase): ...@@ -149,11 +149,11 @@ class TestCase1(TestBase):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) iipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
else: else:
program = main_prog program = main_prog
......
...@@ -102,8 +102,8 @@ class TestTopKOp(IPUOpTest): ...@@ -102,8 +102,8 @@ class TestTopKOp(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
...@@ -78,8 +78,8 @@ class TestBase(IPUOpTest): ...@@ -78,8 +78,8 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
...@@ -76,8 +76,8 @@ class TestBase(IPUOpTest): ...@@ -76,8 +76,8 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
...@@ -91,8 +91,8 @@ class TestBase(IPUOpTest): ...@@ -91,8 +91,8 @@ class TestBase(IPUOpTest):
if run_ipu: if run_ipu:
feed_list = self.feed_list feed_list = self.feed_list
ipu_strategy = compiler.get_ipu_strategy() ipu_strategy = paddle.static.IpuStrategy()
ipu_strategy.is_training = self.is_training ipu_strategy.SetGraphConfig(is_training=self.is_training)
program = compiler.IPUCompiledProgram( program = compiler.IPUCompiledProgram(
main_prog, main_prog,
ipu_strategy=ipu_strategy).compile(feed_list, fetch_list) ipu_strategy=ipu_strategy).compile(feed_list, fetch_list)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册