code: def execute(cls, ctx, op):
      raw_inputs = [ctx[c.key] for c in op.inputs]
      is_input_tuple = isinstance(raw_inputs[0], tuple)
      input_tuple_len = len(raw_inputs[0]) if is_input_tuple else 1
  
      if is_input_tuple:
          # situation that stack is used during tiling, not created by user
          inputs = list(itertools.chain.from_iterable(raw_inputs))
      else:
          inputs = raw_inputs
      # move all the data to the same device
      inputs, device_id, xp = as_same_device(
          inputs, device=op.device, ret_extra=True
      )
      if is_input_tuple:
          inputs = [
              inputs[i * input_tuple_len : (i + 1) * input_tuple_len]
              for i in range(len(raw_inputs))
          ]
      else:
          inputs = [[inp] for inp in inputs]
  
      axis = op.axis
      out = op.outputs[0]
      with device(device_id):
          rets = []
          for i in range(input_tuple_len):
              ret = xp.stack([inp[i] for inp in inputs], axis=axis)
              # make sure order is identical to out's order
              ret = ret.astype(
                  ret.dtype, order=out.order.value, copy=False
              )
              rets.append(ret)
          ctx[out.key] = rets if is_input_tuple else rets[0]
  
file_path: mars/mars/tensor/merge/stack.py
imports: import itertools
  import numpy
  from ...None import opcodes
  from ...serialization.serializables import Int32Field
  from ...utils import has_unknown_shape
  from ..utils import unify_chunks, check_out_param
  from ..array_utils import as_same_device, device
  from ..operands import TensorOperand, TensorOperandMixin
  from ..datasource import tensor
  from ..core import Tensor, TensorOrder
label_desc: Use image node_id 5 for calling the TensorStack obj's underlying member method code with example usage: obj.execute(cls, ctx, op) without return types