code: def test_inference_loader_shapes_small_batch(loader_factory):
      loader = loader_factory(
          dataset=get_dataset(),
          prediction_interval_length=1.0,
          context_interval_length=1.5,
          is_train=False,
          override_args={"batch_size": 2},
      )
  
      batches = list(loader)
      assert len(batches) == 2
      batch = batches[0]
  
      assert batch["past_target"].shape[2] == 2
      assert batch["past_target"].shape[0] == 2
      assert batch["past_valid_length"].shape[0] == 2
  
imports: import itertools
  from functools import partial
  from typing import Iterable
  import numpy
  from pandas.tseries.frequencies import to_offset
  import pytest
  from gluonts.dataset.common import Dataset
  from gluonts.dataset.loader import DataBatch, InferenceDataLoader, TrainDataLoader
  from gluonts.mx.batchify import _pad_arrays, batchify, stack
  from gluonts.testutil.dummy_datasets import get_dataset
  from gluonts.transform import ContinuousTimeInstanceSplitter, ContinuousTimeUniformSampler, ContinuousTimePredictionSampler
label_desc: Use image node_id 5 for calling a global function with example usage: test_inference_loader_shapes_small_batch(loader_factory) without return types