Skip to content

torch.save is saving too much #1995

@glample

Description

@glample

If I have a tensor x of size (100000000,), and I save it with torch.save(x[:10]), it will take a lot of space in the disk (same space than if I save the entire tensor). However, torch.save(x[:10].clone()) only seems to serialize the relevant part of the tensor.

Is it expected behaviour?

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