You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you look at one of the examples that are currently in the top comment, you'll see this:
bernoulli_rng(::vector[n])::int[n]
StanBlocks.jl needs to know how the size information of the arguments to the function propagate to its return value to be able to infer types and dimensions of all expressions.
I must assume that stanc may not actually have that information? Because only the type and "rank" (i.e. is it int, or array[] int, or array[,] int) is checked at compile time by stanc? And then the compatibility of any argument/operator arguments is only checked at runtime by appropriate checks on the underlying (e.g.) Eigen objects?
Correct, stanc does not have that information. That said, I think in almost every case the requirement is that the sizes be the same for all argumentd, with a few notable exceptions like matmuls
Activity
[-]`mdivide_left_tri_low` is missing[/-][+]Some built in stan functions are missing[/+]Work on #10
Merge pull request #33 from nsiccha/fix-10
nsiccha commentedon Oct 16, 2025
@WardBrian: Not that you should care about me fixing this issue - but I think you're the person who could answer the following question immediately:
Is there an easy way to write out all built-in Stan functions and their supported signatures - ideally with the sizes on top of their return types?
If this could be automated (e.g. via stanc), I could ensure that StanBlocks.jl is always up to date with Stan proper.
WardBrian commentedon Oct 16, 2025
stanc —dump-stan-math-signatures does this for all the functions except the variadics (though I’m not sure what you mean by sizes?)
nsiccha commentedon Oct 17, 2025
Ah - apologies!
If you look at one of the examples that are currently in the top comment, you'll see this:
StanBlocks.jl needs to know how the size information of the arguments to the function propagate to its return value to be able to infer types and dimensions of all expressions.
I must assume that stanc may not actually have that information? Because only the type and "rank" (i.e. is it
int, orarray[] int, orarray[,] int) is checked at compile time by stanc? And then the compatibility of any argument/operator arguments is only checked at runtime by appropriate checks on the underlying (e.g.) Eigen objects?WardBrian commentedon Oct 17, 2025
Correct, stanc does not have that information. That said, I think in almost every case the requirement is that the sizes be the same for all argumentd, with a few notable exceptions like matmuls
nsiccha commentedon Oct 17, 2025
Yeah - that was my hope as well! :)
Thanks for your help!