Skip to content

Commit

Permalink
Type Model.register_rv for for downstream typing
Browse files Browse the repository at this point in the history
In pymc/distributions/distribution.py, this change allows the type checker to infer that `rv_out` can only be a TensorVariable.
  • Loading branch information
thomasaarholt committed Sep 4, 2024
1 parent cb9cc57 commit 383d08e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pymc/model/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,16 +1166,16 @@ def set_data(

def register_rv(
self,
rv_var,
name,
rv_var: TensorVariable,
name: str,
*,
observed=None,
total_size=None,
dims=None,
default_transform=UNSET,
transform=UNSET,
initval=None,
):
) -> TensorVariable:
"""Register an (un)observed random variable with the model.
Parameters
Expand Down

0 comments on commit 383d08e

Please sign in to comment.