code: def test_cutout(self):
      random_image = torch.rand(2, 3, 100, 100)
      torch.manual_seed(7)
      co = Cutout(1, 10)
      state = {torchbearer.X: random_image}
      co.on_sample(state)
      reg_img = state[torchbearer.X].view(-1)
  
      x = [21, 86]
      y = [15, 92]
  
      known_cut = random_image.clone().numpy()
      known_cut[
          0,
          :,
          y[0] - 10 // 2 : y[0] + 10 // 2,
          x[0] - 10 // 2 : x[0] + 10 // 2,
      ] = 0
      known_cut[
          1,
          :,
          y[1] - 10 // 2 : y[1] + 10 // 2,
          x[1] - 10 // 2 : x[1] + 10 // 2,
      ] = 0
      known_cut = torch.from_numpy(known_cut)
      known_cut = known_cut.view(-1)
  
      diff = (torch.abs(known_cut - reg_img) > 1e-4).any()
      self.assertTrue(diff.item() == 0)
  
file_path: torchbearer/tests/callbacks/test_cutout.py
imports: from unittest import TestCase
  import torch
  import torchbearer
  from torchbearer.callbacks.cutout import Cutout, RandomErase, CutMix
label_desc: Use image node_id 1 for calling the TestCutOut obj's underlying member method code with example usage: obj.test_cutout() without return types