def build_expression(_, expr):  # pragma: no cover
    """Build a cupy function based on ``arrays`` and ``expr``."""

    def cupy_contract(*arrays):
        return expr._contract([to_cupy(x) for x in arrays], backend="cupy").get()

    return cupy_contract
Build a cupy function based on ``arrays`` and ``expr``.
opt_einsum/backends/cupy.py