code: def test_1d(self):
      a = torch.tensor([[list(range(10))]], dtype=torch.float)
      out = apply_filter(a, torch.tensor([-1, 0, 1]), stride=1)
      expected = np.array(
          [[[1.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, -8.0]]]
      )
      np.testing.assert_allclose(out.cpu().numpy(), expected, rtol=1e-4)
      if torch.cuda.is_available():
          out = apply_filter(a.cuda(), torch.tensor([-1, 0, 1]).cuda())
          np.testing.assert_allclose(
              out.cpu().numpy(), expected, rtol=1e-4
          )
  
file_path: MONAI/tests/test_apply_filter.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from monai.networks.layers import apply_filter
label_desc: Use image node_id 1 for calling the ApplyFilterTestCase obj's underlying member method code with example usage: obj.test_1d() without return types