Fixed TensorSolve to support infer_shape only when axes is None.