code: def test_cval(self):
      device = "cuda" if torch.cuda.is_available() else "cpu:0"
      inputs = torch.ones((1, 1, 3, 3)).to(device=device)
      roi_shape = (5, 5)
      sw_batch_size = 10
  
      def compute(data):
          return data + data.sum()
  
      result = sliding_window_inference(
          inputs,
          roi_shape,
          sw_batch_size,
          compute,
          overlap=0.5,
          padding_mode="constant",
          cval=-1,
          mode="constant",
          sigma_scale=1.0,
      )
      expected = np.ones((1, 1, 3, 3)) * -6.0
      np.testing.assert_allclose(
          result.cpu().numpy(), expected, rtol=1e-4
      )
  
      result = SlidingWindowInferer(
          roi_shape,
          sw_batch_size,
          overlap=0.5,
          mode="constant",
          cval=-1,
      )(inputs, compute)
      np.testing.assert_allclose(
          result.cpu().numpy(), expected, rtol=1e-4
      )
  
file_path: MONAI/tests/test_sliding_window_inference.py
imports: from __future__ import annotations
  import itertools
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.data.utils import list_data_collate
  from monai.inferers import SlidingWindowInferer, SlidingWindowInfererAdapt, sliding_window_inference
  from monai.utils import optional_import
  from tests.utils import TEST_TORCH_AND_META_TENSORS, skip_if_no_cuda, test_is_quick
label_desc: Use image node_id 6 for calling the TestSlidingWindowInference obj's underlying member method code with example usage: obj.test_cval() and returns: unknown