We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbb5deb commit 8eae98dCopy full SHA for 8eae98d
autograd/container_types.py
@@ -66,7 +66,11 @@ def __init__(self, value):
66
self.shape = [vspace(x) for x in value]
67
self.size = sum(s.size for s in self.shape)
68
self.sequence_type = type(value)
69
- self.lib = vspace(value[0]).lib
+ if value:
70
+ # If this a list without elements, we'll just not set the
71
+ # library; there's a chance this space is nested and that
72
+ # this won't be needed. Otherwise it'll crash later
73
+ self.lib = vspace(value[0]).lib
74
assert self.sequence_type in (tuple, list)
75
76
def zeros(self):
0 commit comments