Middle.Stan_math_signatures
This module stores a table of all signatures from the Stan math C++ library which are exposed to Stan, and some helper functions for dealing with those signatures.
type fun_arg = UnsizedType.autodifftype * UnsizedType.t
Function arguments are represented by their type an autodiff type. This is AutoDiffable
for everything except arguments marked with the data keyword
type signature = UnsizedType.returntype * fun_arg list * Mem_pattern.t
Signatures consist of a return type, a list of arguments, and a flag for whether or not those arguments can be Struct of Arrays objects
val stan_math_signatures : (string, signature list) Core.Hashtbl.t
Mapping from names to signature(s) of functions
type variadic_signature = {
return_type : UnsizedType.t;
control_args : fun_arg list;
required_fn_rt : UnsizedType.t;
required_fn_args : fun_arg list;
}
val stan_math_variadic_signatures : (string, variadic_signature) Core.Hashtbl.t
Mapping from names to description of a variadic function.
Note that these function names cannot be overloaded, and usually require customized code-gen in the backend.
Equivalent to Hashtbl.mem stan_math_variadic_signatures s
Pretty printers
val pp_math_sig : signature Fmt.t
val pp_fkind :
Ppx_deriving_runtime.Format.formatter ->
fkind ->
Ppx_deriving_runtime.unit
val show_fkind : fkind -> Ppx_deriving_runtime.string
val distributions :
(fkind list * string * dimensionality list * Mem_pattern.t) list
The distribution families exposed by the math library
Helpers for dealing with operators as signatures
val operator_to_stan_math_fns : Operator.t -> string list
val pretty_print_math_lib_operator_sigs : Operator.t -> string list
val make_assignmentoperator_stan_math_signatures : Operator.t -> signature list
Special functions for the variadic signatures exposed
val reduce_sum_slice_types : UnsizedType.t list