Utility function. Same as subset_dim, but along the
single dimension with index which_dim
.
subset_single_dim(x, which_dim, dim_length, random)
object to subset
index of dimension along which to subset
new length/size of the dimension of x
with index which_dim
logical, whether to take a random subset or just the head.