Remove the identical if branch (#18019)
authoryuanhaoxie <yuanhaox@gmail.com>
Fri, 15 Mar 2019 20:09:18 +0000 (13:09 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 15 Mar 2019 20:14:26 +0000 (13:14 -0700)
Summary:
elif branch and else branch have the same content.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18019

Differential Revision: D14475107

Pulled By: ezyang

fbshipit-source-id: 5075cc938f57649af7537de1a7c9d76ea976cafc

caffe2/python/model_helper.py

index e7deb04..166050d 100644 (file)
@@ -288,11 +288,6 @@ class ModelHelper(object):
 
         if namescope == '':
             return self.params[:]
-        elif top_scope:
-            return [
-                p for p in self.params
-                if p.GetNameScope().startswith(namescope)
-            ]
         else:
             return [p for p in self.params if
                     p.GetNameScope().startswith(namescope)]