Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Introducing dims syntax? #5

@srush

Description

@srush

I'm finding this part a bit clunky in my code, and it seems like a great source of errors if you mess up this order.

batch, channel, width, height = dims(4)
input_positional = torch.rand(2, 3, 224, 224)
input = input_positional[batch, channel, width, height]

Kind of curious whether something like this is possible? I guess it is important to start with unordered for various reasons, but it is a bit awkward.

batch, channel, width, height = dims(size=[2, 3, 224, 224])
input_positional = torch.rand(batch, channel, width, height)

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