Skip to content

Commit b0c28ec

Browse files
oops
1 parent 302e5ed commit b0c28ec

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

torch/nn/modules/module.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,6 @@ def add_module(self, name, module):
163163
if not isinstance(module, Module) and module is not None:
164164
raise TypeError("{} is not a Module subclass".format(
165165
torch.typename(module)))
166-
elif name is None or not isinstance(name, torch._six.string_types):
167-
raise TypeError("{} is not a Module subclass".format(
168-
torch.typename(module)))
169166
elif hasattr(self, name) and name not in self._modules:
170167
raise KeyError("attribute '{}' already exists".format(name))
171168
elif '.' in name:

0 commit comments

Comments
 (0)