code: def test_cutmix_targets(self):
      random_image = torch.rand(2, 3, 100, 100)
      torch.manual_seed(7)
      co = CutMix(1.0, classes=4)
      target = torch.tensor(
          [[0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 0.0, 1.0]]
      )
      state = {
          torchbearer.X: random_image,
          torchbearer.Y_TRUE: torch.tensor([1, 3]).long(),
          torchbearer.DEVICE: "cpu",
      }
      co.on_sample(state)
      self.assertTrue(
          ((state[torchbearer.TARGET] - target).abs() < 0.00001).all()
      )
      state = {
          torchbearer.X: random_image,
          torchbearer.Y_TRUE: torch.tensor([1, 3]).long(),
      }
      co.on_sample_validation(state)
      self.assertTrue(
          ((state[torchbearer.TARGET] - target).abs() < 0.00001).all()
      )
      state = {
          torchbearer.X: random_image,
          torchbearer.Y_TRUE: target.long(),
      }
      co.on_sample_validation(state)
      self.assertTrue(
          ((state[torchbearer.TARGET] - target).abs() < 0.00001).all()
      )
  
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 5 for calling the TestCutOut obj's underlying member method code with example usage: obj.test_cutmix_targets() without return types