Skip to content

Parameter vs. buffer #19

@f0k

Description

@f0k

The implementations currently use nn.Parameter to store precomputed values such as the window function or filterbank. I think they should be buffers instead, registered via model.register_buffer(), so they can be Tensors instead of Variables.

In fact, they should neither be Parameters nor buffers, because they should not become part of the state_dict, but PyTorch does not support this directly. You'd either make them a normal attribute and override _apply() so they are moved between devices correctly, or make them a buffer and override state_dict so they're not included in it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions