keras/src/backend/numpy/linalg.py/solve_triangular
def solve_triangular(a, b, lower=False):
    if a.ndim == 2:
        return sl.solve_triangular(a, b, lower=lower)

    _vectorized_solve_triangular = np.vectorize(
        lambda a, b: sl.solve_triangular(a, b, lower=lower),
        signature="(n,n),(n,m)->(n,m)",
    )
    if b.ndim == a.ndim - 1:
        b = np.expand_dims(b, axis=-1)
        return _vectorized_solve_triangular(a, b).squeeze(axis=-1)
    return _vectorized_solve_triangular(a, b)