computing the dims_out can be generalized to c code from the python code:
```
        width_sum = 0
        out_shape = copy of input_1.shape
        for cnda in cndas:
            width_sum += cnda.shape[axis]
            # and while we're at it, check that shapes match
        out_shape[axis] = width_sum;
```