Skip to content

Slicing a nn.ModuleList #974

@jzbontar

Description

@jzbontar

Slicing operation don't seem to work on nn.ModuleList.

from torch import nn
list = nn.ModuleList([nn.Module(), nn.Module()])
print list[1:]

produces the following error:

KeyError: 'slice(1, None, None)'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions