your description of a problem is pretty incoherent. what does it mean for a linear equation system to be 3d? can't you just reshape the arrays to be A (n, m), X (n, m), B (m,) where m = n*d? (eg A2d = A3d.reshape((n, n*d)))
then the np.linalg.solve or np.linalg.lstsq will do the job.
also, what kind of process produces such a task?