Skip to content

Please make Tensor subclass name arg optional #614

@profPlum

Description

@profPlum

Is your feature request related to a problem? Please describe.

torch.nn.utils.parametrize relies on dynamically sub-typing modules (including e.g. ComplexTensor types) which fails because Tensorly has a very unusual requirement: putting a name kwd-arg in all sub-classes definition.

Describe the solution you'd like

This name kwd-arg shouldn't be mandatory, you can simply set the default to the sub-class's __name__ attribute which is already provided in every standard class definition. This will allow compatibility with this core pytorch module, reduce definition verbosity, developer surprises, and maintain backwards compatibility.

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