PyTensor utils#

compile_pymc(inputs, outputs[, random_seed, ...])

Use pytensor.function with specialized pymc rewrites always enabled.

gradient(f[, vars])

hessian(f[, vars, negate_output])

hessian_diag(f[, vars, negate_output])

jacobian(f[, vars])

inputvars(a)

Get the inputs into PyTensor variables

cont_inputs(a)

Get the continuous inputs into PyTensor variables

floatX(X)

Convert an PyTensor tensor or numpy array to pytensor.config.floatX type.

intX(X)

Convert a pytensor tensor or numpy array to pytensor.tensor.int32 type.

smartfloatX(x)

Converts numpy float values to floatX and leaves values of other types unchanged.

constant_fold(xs[, raise_not_constant])

Use constant folding to get constant values of a graph.

CallableTensor(tensor)

Turns a symbolic variable with one input into a function that returns symbolic arguments with the one variable replaced with the input.

join_nonshared_inputs(point, outputs, inputs)

Create new outputs and input TensorVariables where the non-shared inputs are joined in a single raveled vector input.

make_shared_replacements(point, vars, model)

Makes shared replacements for all other variables than the ones passed.

generator(gen[, default])

Generator variable with possibility to set default value and new generator.

convert_observed_data(data)

Convert user provided dataset to accepted formats.