code: def test_cuda_precise(
      self, test_case_description, sigmas, input, expected
  ):
      # Skip this test
      if not torch.cuda.is_available():
          return
  
      # Params to determine the implementation to test
      device = torch.device("cuda")
  
      # Create input tensor and apply filter
      input_tensor = torch.from_numpy(np.array(input)).to(
          dtype=torch.double, device=device
      )
  
      len_input = len(input_tensor.shape)
      # C++ extension so far only supports 5-dim inputs.
      if len_input == 3:
          input_tensor = input_tensor.unsqueeze(3).unsqueeze(4)
      elif len_input == 4:
          input_tensor = input_tensor.unsqueeze(4)
  
      output = (
          TrainableBilateralFilterFunction.apply(input_tensor, *sigmas)
          .cpu()
          .numpy()
      )
  
      # Make sure to return tensor of the same shape as the input.
      if len_input == 3:
          output = output.squeeze(4).squeeze(3)
      elif len_input == 4:
          output = output.squeeze(4)
  
      # Ensure result are as expected.
      np.testing.assert_allclose(output, expected, atol=1e-5)
  
file_path: MONAI/tests/test_trainable_bilateral.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from torch.autograd import gradcheck
  from monai.networks.layers.filtering import TrainableBilateralFilterFunction
  from tests.utils import skip_if_no_cpp_extension, skip_if_no_cuda
label_desc: Use image node_id 1 for calling the BilateralFilterTestCaseCudaPrecise obj's underlying member method code with example usage: obj.test_cuda_precise(test_case_description, sigmas, input, expected) without return types