PSA: replacement of ind2sub/sub2ind in Julia 0.7+

Does this work for you?

function ind2subv(shape, indices)
    CI = CartesianIndices(shape)
    return getindex.(Ref(CI), indices)
end