-
Notifications
You must be signed in to change notification settings - Fork 221
Closed
Labels
API changesThis impacts the public API of the project (e.g. inference class).This impacts the public API of the project (e.g. inference class).architectureInternal changes without API consequencesInternal changes without API consequenceshackathon
Milestone
Description
with #1370 we changed the type of the proposal argument to accept_reject_sample to be Callable instead of torch.Distribution to enable passing a sample function directly.
However, it is not controlled whether this callable function behaves like a sample function, e.g., whether it takes a sample_shape as argument. Thus, we have to bypass the type checker here.
As a solution, I suggest defining a protocal that has a callable method with sample_shape-like input argument.
Note, this kind of approach could also apply to the way we handle potential_fns, i.e., using Python protocols instead of abstract base classes for controlling the types.
To be discussed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
API changesThis impacts the public API of the project (e.g. inference class).This impacts the public API of the project (e.g. inference class).architectureInternal changes without API consequencesInternal changes without API consequenceshackathon