docstr: Verify that the reset points are correctly computed
docstr_tok: ["Verify","that","the","reset","points","are","correctly","computed"]
code: def test_find_best_reset_points(self) -> None:
      """
      Verify that the reset points are correctly computed
      """
      activations = [10, 8, 8, 9, 7, 7, 5, 4, 4]
  
      # Check boundary condition: no checkpoints
      memory, split_points = find_best_reset_points(
          activations, nb_checkpoints=0
      )
      self.assertEqual(memory, sum(activations))
  
      # Check boundary condition: checkpoints everywhere
      memory, split_points = find_best_reset_points(
          activations, nb_checkpoints=len(activations)
      )
      self.assertEqual(memory, max(activations))
  
      # Check one checkpoint allocation
      memory, split_points = find_best_reset_points(
          activations, nb_checkpoints=1
      )
      self.assertEqual(memory, 35)
      self.assertEqual(split_points, [4])
      self.assertEqual(sum(activations[: split_points[0]]), 35)
      self.assertEqual(sum(activations[split_points[0] :]), 27)
  
      # Check multiple checkpoint allocation
      memory, split_points = find_best_reset_points(
          activations, nb_checkpoints=2
      )
      self.assertEqual(memory, 24)
      delimiters = [0] + split_points + [len(activations)]
      splits_memory = [
          sum(activations[i:j])
          for i, j in zip(delimiters[:-1], delimiters[1:])
      ]
      self.assertEqual(max(splits_memory), memory)
  
file_path: vissl/tests/test_layer_memory_tracking.py
imports: import unittest
  import torch
  import torch.distributed
  import torch.multiprocessing
  import torch.nn
  import torchvision.models
  from fairscale.nn import FullyShardedDataParallel
  from vissl.utils.layer_memory_tracking import find_best_reset_points, LayerwiseMemoryTracker, ProcessGroupTracker
  from vissl.utils.test_utils import gpu_test, init_distributed_on_file, with_temp_files, with_timing
label_desc: Use image node_id 5 for calling the TestLayerMemoryTracking obj's underlying member method code with example usage: obj.test_find_best_reset_points() without return types