Skip to content

[Bug]: pad_right_to in data_utils.py does not check ndim correctly #1883

@anthony-wss

Description

@anthony-wss

Describe the bug

Hi,
When I am training the voxlingua107 recipe with my own data, I found out that in line 418 of speechbrain/utils/data_utils.py:

if not (
    any(
        [tensors[i].ndim == tensors[0].ndim for i in range(1, len(tensors))]
    )
):
    raise IndexError("All tensors must have same number of dimensions")

I suppose that this code should raise an error when the ndim of the tensor in tensors list is not the same, but it should be all instead of any in order to go into the if statement if some tensors have wrong ndim?

Thanks!

Expected behaviour

Raise an exception when the dimension of tensors is not the same.

To Reproduce

No response

Versions

No response

Relevant log output

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions