-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
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 workThis seem related to #13
Metadata
Metadata
Assignees
Labels
No labels