code: def _to_vector(cls, ctx, xp, x, op):
      out_chunk_size = op.reduce_sizes
      start_poses = op.start_positions
  
      i_indices, j_indices = xp.mgrid[
          start_poses[0] : start_poses[0] + x.shape[0],
          start_poses[1] : start_poses[1] + x.shape[1],
      ]
      filtered = i_indices < j_indices
      i_indices, j_indices, x = (
          i_indices[filtered],
          j_indices[filtered],
          x[filtered],
      )
  
      d = op.x_shape[0]
      row_sizes = xp.arange(d - 1, -1, -1)
      row_cum_sizes = xp.empty((d + 1,), dtype=int)
      row_cum_sizes[0] = 0
      xp.cumsum(row_sizes, out=row_cum_sizes[1:])
      to_indices = (
          row_cum_sizes[i_indices]
          + j_indices
          - (d - row_sizes[i_indices])
      )
  
      cum_chunk_size = [0] + np.cumsum(out_chunk_size).tolist()
      for i in range(len(out_chunk_size[0])):
          index_range = cum_chunk_size[i], cum_chunk_size[i + 1]
          filtered = (to_indices >= index_range[0]) & (
              to_indices < index_range[1]
          )
          out_indices = to_indices[filtered] - cum_chunk_size[i]
          ctx[op.outputs[0].key, (i,)] = out_indices, x[filtered]
  
imports: import itertools
  import numpy
  from ....None import opcodes
  from ....core import recursive_tile
  from ....core.operand import OperandStage
  from ....serialization.serializables import FieldTypes, KeyField, BoolField, TupleField
  from ....config import options
  from ....utils import has_unknown_shape, require_module
  from ...core import TensorOrder
  from ...operands import TensorMapReduceOperand, TensorOperandMixin, TensorShuffleProxy
  from ...datasource import ascontiguousarray, array, zeros
  from ...arithmetic import equal
  from ...utils import decide_chunk_sizes
  from ...array_utils import as_same_device, device, cp
label_desc: Use image node_id 15 for calling the TensorSquareform obj's underlying member method code with example usage: obj._to_vector(cls, ctx, xp, x, op) without return types