code: def execute(cls, ctx, op):
      inputs, device_id, xp = as_same_device(
          [ctx[c.key] for c in op.inputs],
          device=op.device,
          ret_extra=True,
      )
  
      with device(device_id):
          if xp is np:
              ctx[op.outputs[0].key] = xp.einsum(
                  op.subscripts,
                  *inputs,
                  optimize=op.optimize,
                  dtype=op.dtype,
                  order=op.order,
                  casting=op.casting,
              )
          else:
              # Cupy doesn't support `optimize`, `order` and `casting`.
              ctx[op.outputs[0].key] = xp.einsum(
                  op.subscripts, *inputs, dtype=op.dtype
              )
  
imports: import itertools
  from collections import defaultdict
  import numpy
  from ...None import opcodes
  from ...core import recursive_tile
  from ...serialization.serializables import AnyField, StringField
  from ..array_utils import as_same_device, device
  from ..arithmetic.utils import chunk_tree_add
  from ..core import TensorOrder
  from ..operands import TensorOperand, TensorOperandMixin
  from ..utils import decide_unify_split
  from .einsumfunc import parse_einsum_input, einsum_path
label_desc: Use image node_id 8 for calling the TensorEinsum obj's underlying member method code with example usage: obj.execute(cls, ctx, op) without return types