Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 4 additions & 6 deletions pymc3/distributions/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,17 +339,15 @@ def dist(

@singledispatch
def _get_moment(op, rv, size, *rv_inputs) -> TensorVariable:
"""Fallback method for creating an initial value for a random variable.

Parameters are the same as for the `.dist()` method.
"""
return None


def get_moment(rv: TensorVariable) -> TensorVariable:
"""Fallback method for creating an initial value for a random variable.
"""Method for choosing a representative point/value
that can be used to start optimization or MCMC sampling.

Parameters are the same as for the `.dist()` method.
The only parameter to this function is the RandomVariable
for which the value is to be derived.
"""
size = rv.owner.inputs[1]
return _get_moment(rv.owner.op, rv, size, *rv.owner.inputs[3:])
Expand Down
3 changes: 1 addition & 2 deletions pymc3/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import xarray

from aesara.compile.mode import Mode
from aesara.graph.basic import Constant
from aesara.tensor.sharedvar import SharedVariable
from arviz import InferenceData
from fastprogress.fastprogress import progress_bar
Expand Down Expand Up @@ -2002,7 +2001,7 @@ def sample_prior_predictive(
names.append(rv_var.name)
vars_to_sample.append(rv_var)

inputs = [i for i in inputvars(vars_to_sample) if not isinstance(i, (SharedVariable, Constant))]
inputs = [i for i in inputvars(vars_to_sample) if not isinstance(i, SharedVariable)]

sampler_fn = compile_rv_inplace(
inputs, vars_to_sample, allow_input_downcast=True, accept_inplace=True, mode=mode
Expand Down