Skip to content

modifying applied_operations when there are pending operations raises better error message #6371

@wyli

Description

@wyli

Describe the bug
When the metatensor has pending operations, modifying the applied_operations property may change the final transform output's applied_operations ordering.

for example, the following LambdaD pushes to the applied_operations while pending_operations is trying to combine multiple lazy operations:

Compose(
    [
        ResizeWithPadOrCropD(keys=["img", "seg"], spatial_size=[80, 72, 80]),
        Rotated(keys=["img", "seg"], angle=[np.pi / 2, np.pi / 2, 0], mode="nearest", keep_size=False),
        Lambdad(keys=["img"], func=lambda x: torch.sigmoid((x - x.min()) / x.std())),
    ],
    lazy_evaluation=True,
)

this becomes an issue when we try to inverse the applied_operations.

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