code: def test_2d(self):
      a = torch.tensor(
          [[[list(range(7)), list(range(7, 0, -1)), list(range(7))]]],
          dtype=torch.float,
      )
      expected = np.array(
          [
              [14.0, 21.0, 21.0, 21.0, 21.0, 21.0, 14.0],
              [15.0, 24.0, 27.0, 30.0, 33.0, 36.0, 25.0],
              [14.0, 21.0, 21.0, 21.0, 21.0, 21.0, 14.0],
          ]
      )
      expected = expected[None][None]
      out = apply_filter(
          a, torch.tensor([[1, 1, 1], [1, 1, 1], [1, 1, 1]])
      )
      np.testing.assert_allclose(out.cpu().numpy(), expected, rtol=1e-4)
      if torch.cuda.is_available():
          out = apply_filter(
              a.cuda(),
              torch.tensor([[1, 1, 1], [1, 1, 1], [1, 1, 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 2 for calling the ApplyFilterTestCase obj's underlying member method code with example usage: obj.test_2d() without return types