docstr: Tile series using tree reduction
docstr_tok: ["Tile","series","using","tree","reduction"]
code: def _tile_series(cls, op: "DataFrameMemoryUsage"):
      """
      Tile series using tree reduction
      """
      series = op.inputs[0]
      output = op.outputs[0]
      is_range_index = isinstance(
          series.index_value.value, IndexValue.RangeIndex
      )
  
      chunks_to_reduce = []
      for c in series.chunks:
          new_op = op.copy().reset_key()
          new_op.stage = OperandStage.map
  
          # when the index is ``pd.RangeIndex``, the size should be included
          # after all computations are done
          new_op.index = op.index and not is_range_index
  
          chunks_to_reduce.append(
              new_op.new_chunk(
                  [c], index=c.index, dtype=output.dtype, shape=()
              )
          )
  
      # reduce chunks using tree reduction
      combine_size = options.combine_size
      while len(chunks_to_reduce) > 1:
          new_chunks_to_reduce = []
          for idx in range(0, len(chunks_to_reduce), combine_size):
              new_op = op.copy().reset_key()
              new_op.stage = OperandStage.reduce
  
              new_chunks_to_reduce.append(
                  new_op.new_chunk(
                      chunks_to_reduce[idx : idx + combine_size],
                      shape=(),
                      index=(0,),
                      dtype=output.dtype,
                  )
              )
  
          chunks_to_reduce = new_chunks_to_reduce
  
      # handle RangeIndex at final outputs
      if op.index and is_range_index:
          chunks_to_reduce[
              0
          ].op.range_index_size = (
              series.index_value.to_pandas().memory_usage()
          )
  
      # return series with chunks
      new_op = op.copy().reset_key()
      return new_op.new_scalar(
          [series], dtype=output.dtype, chunks=chunks_to_reduce
      )
  
imports: import operator
  from functools import reduce
  import numpy
  import pandas
  from ...None import opcodes
  from ...config import options
  from ...core.operand import OperandStage
  from ...serialization.serializables import BoolField, Int64Field
  from ...utils import ceildiv, lazy_import
  from ..operands import DataFrameOperand, DataFrameOperandMixin
  from ..core import IndexValue
  from ..utils import parse_index
label_desc: Use image node_id 12 for calling the DataFrameMemoryUsage obj's underlying member method code with example usage: obj._tile_series(cls, op) and returns: new_op