Skip to content

decollate_batch return an empty list #3370

Description

@yiheng-wang-nv

decollate_batch will return an empty list, if input is a dict, and one of its value is an empty list.
For example:

data = {
    "class": ['ToTensord', 'ToTensord'],
    "id": torch.tensor([1, 2]),
    "orig_size": [],
}

decollate_batch(data) will return []

This case comes from a classification task, where I used SupervisedTrainer, and labels are achieved from ToNumpyd. The data in the above example belongs to label_transforms which is in engine.state.batch

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    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