PyLops solvers output the solution as a nd-shaped array if the initial model is fed as nd-arrays or if the initial model is not fed (x0=0) and the operator has forceflat=False. As a side effect, if x0 is NOT passed as a kwarg (but just as the third arg of the solver) and the operator forceflat=False, the output is reshaped even if x0 is a flattened array. I fix this inconsistency making x0 a kwarg when basic solvers are called within a leastsquares solver.
PyLops solvers output the solution as a nd-shaped array if the initial model is fed as nd-arrays or if the initial model is not fed (x0=0) and the operator has forceflat=False. As a side effect, if x0 is NOT passed as a kwarg (but just as the third arg of the solver) and the operator forceflat=False, the output is reshaped even if x0 is a flattened array. I fix this inconsistency making x0 a kwarg when basic solvers are called within a leastsquares solver.