Skip to content

A new case not handled by aten.cat length-0 canonicalization #4333

@lionsky

Description

@lionsky

IR pattern

%76 = torch.prim.ListConstruct %73, %47 : (!torch.vtensor<[0],f32>, !torch.vtensor<[1,4,4,128],f32>) -> !torch.list<vtensor>
%int-2_66 = torch.constant.int -2
%77 = torch.aten.cat %76, %int-2_66 : !torch.list<vtensor>, !torch.int -> !torch.vtensor<[1,4,4,128],f32>

By referring to #2966, it seems we can just ignore the operand when any of its dim size is zero, not only zero at the concat dimension.

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