diff --git a/pymc3/distributions/distribution.py b/pymc3/distributions/distribution.py index 582fa6b2f8..e72a90bed1 100644 --- a/pymc3/distributions/distribution.py +++ b/pymc3/distributions/distribution.py @@ -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:]) diff --git a/pymc3/sampling.py b/pymc3/sampling.py index 8bfd06a1ee..f032ad1fda 100644 --- a/pymc3/sampling.py +++ b/pymc3/sampling.py @@ -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 @@ -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