Skip to content

IR_UNOPT bug when neq == 0 #61

@armanschwarz

Description

@armanschwarz

in batch.py:100 ry is set to 0.0 if there are no equality constraints:

ry = torch.bmm(x.unsqueeze(1), A.transpose(
    1, 2)).squeeze(1) - b if neq > 0 else 0.0

However when using the IR_UNOPT solver, kkt_resid_reg will fail with IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 2) since the below unsqueeze operation is attempted on the float:

dx, ds, dz, dy, rx, rs, rz, ry = [
    x.unsqueeze(2) if x is not None else None for x in
    [dx, ds, dz, dy, rx, rs, rz, ry]                                                                                                                                                                                                                                                                               ]

I lack the understanding of this library to know what the exact fix is, but I thought I'd report it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions