class_docstr: Acceleration structure for accessing mem_records in interval.
class_docstr_tok: ["Acceleration","structure","for","accessing","mem_records","in","interval","."]
code: def __init__(self, mem_records):
      self._mem_records = mem_records
      self._start_uses: List[int] = []
      self._indices: List[int] = []
      if len(mem_records) > 0:
          tmp = sorted(
              [(r[0].start_us(), i) for i, r in enumerate(mem_records)]
          )
          self._start_uses, self._indices = zip(*tmp)
  
imports: import bisect
  import itertools
  import math
  from collections import defaultdict, namedtuple
  from operator import attrgetter
  from typing import Any, Dict, List, Optional, Tuple
  import torch
  from torch.autograd import DeviceType
label_desc: Use image node_id 1 to create a new MemRecordsAcc object  with example: obj = MemRecordsAcc(mem_records)