diff --git a/python/paddle/fluid/initializer.py b/python/paddle/fluid/initializer.py index 54ba5f22e53d6cfc21af87278ecba3849e715c91..6bbbcc2f75043bc942e07ef041cbd2f177e73621 100644 --- a/python/paddle/fluid/initializer.py +++ b/python/paddle/fluid/initializer.py @@ -52,11 +52,7 @@ class Initializer(object): def _check_block(self, block): if block is None: - if in_dygraph_mode(): - block = default_main_program().global_block() - else: - raise ValueError( - "The parameter 'block' is needed in static graph mode.") + block = default_main_program().global_block() return block