Skip to content

Samplers len() might need to be removed #373

@pzelasko

Description

@pzelasko

When working on #372, I noticed that there is an issue in calling len(sampler). We currently compute len by iterating the sampler and caching the number of batches. However, the number of batches (i.e., len) may change when we shuffle the cuts. I don't think there is a really elegant way to provide len (we can't recompute it at the start of an iteration, because len itself calls iter(sampler)...). Unless anybody has some idea, I'll remove len from samplers.

CC @janvainer @danpovey @csukuangfj

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