class_docstr: Object class to write the index (.idx) file
  
  Args:
      idx_path (str): The path to the index file
  
      dtype (Type[numpy.number]): The dtype of the index file
class_docstr_tok: ["Object","class","to","write","the","index","(",".idx",")","file","Args",":","idx_path","(","str",")",":","The","path","to","the","index","file","dtype","(","Type","[","numpy.number","]",")",":","The","dtype","of","the","index","file"]
docstr: Build the sequence pointers per the sequence lengths and dtype size
  
  Args:
      sequence_lengths (List[int]): The length of each sequence
  
  Returns:
      List[int]: The pointer to the beginning of each sequence
docstr_tok: ["Build","the","sequence","pointers","per","the","sequence","lengths","and","dtype","size","Args",":","sequence_lengths","(","List","[","int","]",")",":","The","length","of","each","sequence","Returns",":","List","[","int","]",":","The","pointer","to","the","beginning","of","each","sequence"]
code: def _sequence_pointers(
      self, sequence_lengths: List[int]
  ) -> List[int]:
      """Build the sequence pointers per the sequence lengths and dtype size
  
      Args:
          sequence_lengths (List[int]): The length of each sequence
  
      Returns:
          List[int]: The pointer to the beginning of each sequence
      """
      itemsize = DType.size(self.dtype)
      curr_ptr = 0
      list_ptr = []
      for length in sequence_lengths:
          list_ptr.append(curr_ptr)
          curr_ptr += length * itemsize
      return list_ptr
  
imports: import logging
  import os
  import shutil
  import struct
  import time
  from enum import Enum
  from functools import lru_cache
  from itertools import accumulate
  from types import TracebackType
  from typing import List, Optional, Tuple, Type, Union
  import numpy
  import torch
  from megatron.core.datasets.utils import log_single_rank
label_desc: Use image node_id 5 for calling the _IndexWriter obj's underlying member method code with example usage: obj._sequence_pointers(sequence_lengths) and returns: list_ptr