code: def test_loading_array(self):
      # test sequence input data with images
      images = [
          np.arange(16, dtype=float).reshape(1, 4, 4),
          np.arange(16, dtype=float).reshape(1, 4, 4),
      ]
      # image level
      patch_intensity = RandShiftIntensity(
          offsets=1.0, prob=1.0
      ).set_random_state(seed=1234)
      patch_iter = PatchIter(patch_size=(2, 2), start_pos=(0, 0))
      ds = GridPatchDataset(
          data=images, patch_iter=patch_iter, transform=patch_intensity
      )
      # use the grid patch dataset
      for item in DataLoader(
          ds, batch_size=2, shuffle=False, num_workers=0
      ):
          np.testing.assert_equal(tuple(item[0].shape), (2, 1, 2, 2))
      np.testing.assert_allclose(
          item[0],
          np.array(
              [
                  [[[8.708934, 9.708934], [12.708934, 13.708934]]],
                  [[[10.8683, 11.8683], [14.8683, 15.8683]]],
              ]
          ),
          rtol=1e-4,
      )
      np.testing.assert_allclose(
          item[1],
          np.array(
              [[[0, 1], [2, 4], [0, 2]], [[0, 1], [2, 4], [2, 4]]]
          ),
          rtol=1e-5,
      )
      if sys.platform != "win32":
          for item in DataLoader(
              ds, batch_size=2, shuffle=False, num_workers=2
          ):
              np.testing.assert_equal(
                  tuple(item[0].shape), (2, 1, 2, 2)
              )
          np.testing.assert_allclose(
              item[0],
              np.array(
                  [
                      [[[7.27427, 8.27427], [11.27427, 12.27427]]],
                      [[[9.4353, 10.4353], [13.4353, 14.4353]]],
                  ]
              ),
              rtol=1e-3,
          )
          np.testing.assert_allclose(
              item[1],
              np.array(
                  [[[0, 1], [2, 4], [0, 2]], [[0, 1], [2, 4], [2, 4]]]
              ),
              rtol=1e-5,
          )
  
imports: from __future__ import annotations
  import sys
  import unittest
  import numpy
  from parameterized import parameterized
  from monai.data import DataLoader, GridPatchDataset, PatchIter, PatchIterd, iter_patch
  from monai.transforms import RandShiftIntensity, RandShiftIntensityd
  from monai.utils import set_determinism
  from tests.utils import TEST_NDARRAYS, assert_allclose, get_arange_img
label_desc: Use image node_id 7 for calling the TestGridPatchDataset obj's underlying member method code with example usage: obj.test_loading_array() without return types