Skip to content

Add return type hints #5819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 30, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pymc/distributions/logprob.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
from pymc.aesaraf import floatX


def _get_scaling(total_size: Optional[Union[int, Sequence[int]]], shape, ndim: int):
def _get_scaling(
total_size: Optional[Union[int, Sequence[int]]], shape, ndim: int
) -> TensorVariable:
"""
Gets scaling constant for logp.

Expand Down Expand Up @@ -288,14 +290,14 @@ def logp(rv: TensorVariable, value) -> TensorVariable:
raise NotImplementedError("PyMC could not infer logp of input variable.") from exc


def logcdf(rv, value):
def logcdf(rv, value) -> TensorVariable:
"""Return the log-cdf graph of a Random Variable"""

value = at.as_tensor_variable(value, dtype=rv.dtype)
return logcdf_aeppl(rv, value)


def ignore_logprob(rv):
def ignore_logprob(rv) -> TensorVariable:
"""Return a duplicated variable that is ignored when creating Aeppl logprob graphs

This is used in SymbolicDistributions that use other RVs as inputs but account
Expand Down