Either check that `size(a) == prod(dims)` or fetch from `refs[1]` to ensure that the reshape was successful.