code: def test_lstnet(
      skip_size,
      ar_window,
      lead_time,
      prediction_length,
      hybridize,
      scaling,
      dtype,
  ):
      estimator = LSTNetEstimator(
          skip_size=skip_size,
          ar_window=ar_window,
          num_series=NUM_SERIES,
          channels=6,
          kernel_size=2,
          context_length=4,
          lead_time=lead_time,
          prediction_length=prediction_length,
          trainer=Trainer(
              epochs=1, learning_rate=0.01, hybridize=hybridize
          ),
          scaling=scaling,
          dtype=dtype,
      )
  
      predictor = estimator.train(dataset.train)
  
      with tempfile.TemporaryDirectory() as directory:
          predictor.serialize(Path(directory))
          predictor_copy = Predictor.deserialize(Path(directory))
          assert predictor == predictor_copy
  
      forecast_it, ts_it = make_evaluation_predictions(
          dataset=dataset.test,
          predictor=predictor,
          num_samples=NUM_SAMPLES,
      )
      forecasts = list(forecast_it)
      tss = list(ts_it)
      assert len(forecasts) == len(tss) == len(dataset.test)
  
      test_ds = next(iter(dataset.test))
  
      for fct in forecasts:
          assert fct.freq == freq
          assert fct.samples.shape == (
              NUM_SAMPLES,
              prediction_length,
              NUM_SERIES,
          )
          assert (
              fct.start_date
              == pd.period_range(
                  start=test_ds["start"],
                  periods=test_ds["target"].shape[
                      1
                  ],  # number of test periods
                  freq=freq,
              )[-prediction_length]
          )
  
      evaluator = MultivariateEvaluator(
          quantiles=[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
      )
      agg_metrics, item_metrics = evaluator(
          iter(tss), iter(forecasts), num_series=len(dataset.test)
      )
      assert agg_metrics["ND"] < 1.0
  
file_path: gluonts/test/mx/model/lstnet/test_lstnet.py
imports: import tempfile
  from pathlib import Path
  import numpy
  import pandas
  import pytest
  from gluonts.dataset.artificial import constant_dataset
  from gluonts.dataset.common import TrainDatasets
  from gluonts.dataset.multivariate_grouper import MultivariateGrouper
  from gluonts.evaluation import make_evaluation_predictions, MultivariateEvaluator
  from gluonts.mx.model.lstnet import LSTNetEstimator
  from gluonts.model.predictor import Predictor
  from gluonts.mx.trainer import Trainer
label_desc: Use image node_id 2 for calling a global function with example usage: test_lstnet(skip_size, ar_window, lead_time, prediction_length, hybridize, scaling, dtype) without return types