code: def add_memory_record(self, size, allocation_type):
      if (
          allocation_type == "Allocate"
          or allocation_type == "ReservedAllocate"
      ):
          self.allocation_count += 1
          self.allocation_size += size
  
      elif (
          allocation_type == "Free" or allocation_type == "ReservedFree"
      ):
          self.free_count += 1
          self.free_size -= size  # size is sign(-) when free.
  
      else:
          print("No corresponding type.")
      self.increase_size = self.allocation_size - self.free_size
  
file_path: VisualDL/visualdl/component/profiler/parser/memory_parser.py
imports: import collections
  from .utils import traverse_tree
label_desc: Use image node_id 2 for calling the MemoryItem obj's underlying member method code with example usage: obj.add_memory_record(size, allocation_type) without return types