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])


Get the inputs into PyTensor variables


Get the continuous inputs into PyTensor variables


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


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


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.


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 user provided dataset to accepted formats.