It would be useful if transform would have an option, so that the result remains a flat vector:
transform(t, x, keep_flat=true)
A good use case is converting MCMC samples in MCMCChains.Chains objects:
import MCMCChains
samp = rand(1000, 5) # we would get them this from a MCMC algorithm
# we get an array of named tuples, which is great to define the model but difficult to convert a `Chain`.
samp_trans1 = mapslices(s -> transform(t, s), samp, dims=2)
MCMCChains.Chains(samp_trans) # fails
# with the new argument we would get an array
samp_trans2 = mapslice(s -> transform(t, s, keep_flat=true), samp, dims=2)
MCMCChains.Chains(samp_trans2) # that would work
This seem related to #13
It would be useful if
transformwould have an option, so that the result remains a flat vector:A good use case is converting MCMC samples in
MCMCChains.Chainsobjects:This seem related to #13