Stack a and b along a new dimension inserted at position dim — this adds an extra dimension to the output, rather than joining the tensors along an existing one.
a
b
dim
solve(...)