code: def test_param(
      self, scale, ratio, value, same_on_batch, device, dtype
  ):
      _scale = (
          scale
          if isinstance(scale, (list, tuple))
          else nn.Parameter(
              scale.clone().to(device=device, dtype=dtype)
          )
      )
      _ratio = (
          ratio
          if isinstance(ratio, (list, tuple))
          else nn.Parameter(
              ratio.clone().to(device=device, dtype=dtype)
          )
      )
  
      torch.manual_seed(0)
      input = (
          torch.randint(255, (2, 3, 10, 10), device=device, dtype=dtype)
          / 255.0
      )
      aug = RandomErasing(_scale, _ratio, value, same_on_batch)
      output = aug(input)
  
      if len(list(aug.parameters())) != 0:
          mse = nn.MSELoss()
          opt = torch.optim.SGD(aug.parameters(), lr=0.1)
          loss = mse(output, torch.ones_like(output) * 2)
          loss.backward()
          opt.step()
  
      if not isinstance(scale, (list, tuple)):
          assert isinstance(aug.scale, torch.Tensor)
          if torch.all(aug.scale._grad == 0.0):
              # grid_sample will return grad = 0 for resample nearest
              # https://discuss.pytorch.org/t/autograd-issue-with-f-grid-sample/76894
              assert (
                  scale.to(device=device, dtype=dtype) - aug.scale.data
              ).sum() == 0
          else:
              # Assert if param not updated
              assert (
                  scale.to(device=device, dtype=dtype) - aug.scale.data
              ).sum() != 0
      if not isinstance(ratio, (list, tuple)):
          assert isinstance(aug.ratio, torch.Tensor)
          if torch.all(aug.ratio._grad == 0.0):
              # grid_sample will return grad = 0 for resample nearest
              # https://discuss.pytorch.org/t/autograd-issue-with-f-grid-sample/76894
              assert (
                  ratio.to(device=device, dtype=dtype) - aug.ratio.data
              ).sum() == 0
          else:
              # Assert if param not updated
              assert (
                  ratio.to(device=device, dtype=dtype) - aug.ratio.data
              ).sum() != 0
  
imports: import pytest
  import torch
  from torch import nn
  from kornia.augmentation import ColorJiggle, ColorJitter, RandomAffine, RandomErasing, RandomMotionBlur, RandomPerspective, RandomResizedCrop, RandomRotation, RandomSharpness
label_desc: Use image node_id 1 for calling the TestRandomErasingBackward obj's underlying member method code with example usage: obj.test_param(scale, ratio, value, same_on_batch, device, dtype) without return types