Skip to content

Remove Callable parent of TorchDistributionMixin #3442

@kosiokarchev

Description

@kosiokarchev

Will it be possible to remove Callable from the parents of TorchDistributionMixin (introduced in version 1.9)?
I'd like to make a generic subclass like

class MyDist(TorchDistribution, Generic[_T]): ...

and use it as MyDist[SomeConcreteType], but this fails because Callable enforces a specific usage pattern MyDist[[arg_type, ...], return_type].
On the other hand, introspection tools (in my experience) and the built-in callable already pick up the "callability" from the __call__ method.

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