Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] More arguments for td.memmap_() #178

Closed
3 tasks
vmoens opened this issue Jan 23, 2023 · 1 comment
Closed
3 tasks

[Feature Request] More arguments for td.memmap_() #178

vmoens opened this issue Jan 23, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@vmoens
Copy link
Contributor

vmoens commented Jan 23, 2023

Motivation

Since TensorDict.memmap_() creates a copy on physical mem of the content of a tensordict, it would be nice to have some more options:

  • MemmapTensors are temporary files. It could be nice to disable this when calling memmap_() (like temporary=False). In that way, one would know that the content of the memmap will be kept in memory after the process exits.
  • We should also be able to pass the path to where the files have to be saved (`path="/path/to/my_tensordict"). This would work nicely with [Feature Request] Saving and loading memmap tensordicts / tensorclasses #176
  • Similarly, it could be neat to be able to control if a memmap_ tensor can be written or not (by passing mode="r+" for instance). Of course, memmap_() would always write the content but then modify the permissions accordingly to make sure that the content is somewhat locked for in-place modifs.
@vmoens vmoens added the enhancement New feature or request label Jan 23, 2023
@vmoens vmoens self-assigned this Jan 23, 2023
@vmoens
Copy link
Contributor Author

vmoens commented Jan 23, 2023

cc @sreevasthav

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants