Skip to content

Clean up buffer inside DataPipe instance during destruction #370

@ejguan

Description

@ejguan

🚀 The feature

Could we add __del__ to clean up buffer, which are attached to DataPipe instance.

  • Demux
  • Fork
  • etc

Motivation, pitch

We may encounter the problem that the objects inside buffer are not clean up by DataPipe instance itself but relied on gc to clean up.
This could potentially to resolve the problem from pytorch/vision#5801 (comment)

TorchVision chose to ignore the ResourceWarning for the test suite. But, we still need to consider for other domains or users who want to keep these warnings.

Alternatives

No response

Additional context

No response

cc: @NivekT

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