Skip to content

Commit

Permalink
refine coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangbo9674 committed Jan 7, 2022
1 parent 07836b1 commit ca208b3
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,14 @@ def __init__(self):

self.assertRaises(TypeError, test_error_model)

def test_error_distributed_model():
model = fluid.dygraph.Conv2D(3, 2, 3, bias_attr=False, act=None)
model = paddle.DataParallel(model)
with fluid.dygraph.guard():
model = paddle.amp.decorate(models=model, level='O2')

self.assertRaises(RuntimeError, test_error_distributed_model)

def test_error_optimizer():
class MyOptimizer(object):
def __init__(self):
Expand Down

0 comments on commit ca208b3

Please sign in to comment.