code: def execute(cls, ctx, op):
      inputs, device_id, xp = as_same_device(
          [ctx[inp.key] for inp in op.inputs],
          device=op.device,
          ret_extra=True,
      )
  
      with device(device_id):
          if isinstance(op.kth, TENSOR_CHUNK_TYPE):
              kth = inputs[0]
              sort_infos = inputs[1:]
              # make kth all positive
              kth = _validate_kth_value(kth, op.size)
          else:
              kth = op.kth
              sort_infos = inputs
  
          sort_info_shape = sort_infos[0].shape
          # create arrays filled with -1, -1 means do nothing about partition
          partition_infos = [
              xp.full(sort_info_shape + (len(kth),), -1)
              for _ in sort_infos
          ]
          concat_sort_info = xp.stack(
              [sort_info.ravel() for sort_info in sort_infos]
          )
          cumsum_sort_info = xp.cumsum(concat_sort_info, axis=0)
  
          for j in range(cumsum_sort_info.shape[1]):
              idx = xp.unravel_index(j, sort_infos[0].shape)
              sizes = cumsum_sort_info[:, j]
              to_partition_chunk_idxes = xp.searchsorted(
                  sizes, kth, side="right"
              )
              for i, to_partition_chunk_idx in enumerate(
                  to_partition_chunk_idxes
              ):
                  partition_idx = tuple(idx) + (i,)
                  k = kth[i]
                  # if to partition on chunk 0, just set to kth
                  # else kth - {size of previous chunks}
                  chunk_k = (
                      k
                      if to_partition_chunk_idx == 0
                      else k - sizes[to_partition_chunk_idx - 1]
                  )
                  partition_infos[to_partition_chunk_idx][
                      partition_idx
                  ] = chunk_k
  
          for out, partition_info in zip(op.outputs, partition_infos):
              ctx[out.key] = partition_info
  
imports: import itertools
  import numpy
  from ...None import opcodes
  from ...core import recursive_tile
  from ...serialization.serializables import FieldTypes, KeyField, Int32Field, StringField, ListField, BoolField, AnyField
  from ...utils import has_unknown_shape, flatten, stack_back
  from ...core import ENTITY_TYPE, ExecutableTuple
  from ..operands import TensorOperand, TensorShuffleProxy
  from ..core import TENSOR_TYPE, TENSOR_CHUNK_TYPE, TensorOrder
  from ..array_utils import as_same_device, device
  from ..datasource import tensor
  from ..utils import validate_axis, validate_order
  from .psrs import TensorPSRSOperandMixin
label_desc: Use image node_id 6 for calling the CalcPartitionsInfo obj's underlying member method code with example usage: obj.execute(cls, ctx, op) without return types