code: def __call__(  # type: ignore
      self,
      inference_data_loader: DataLoader,
      prediction_net: mx.gluon.Block,
      input_names: List[str],
      output_transform: Optional[OutputTransform],
      num_samples: Optional[int],
      freq: str,
      **kwargs,
  ) -> Iterator[Forecast]:
      for batch in inference_data_loader:
          inputs = [batch[k] for k in input_names]
  
          outputs, valid_length = (
              x.asnumpy() for x in prediction_net(*inputs)
          )
          # outputs (num_parallel_samples, batch_size, max_seq_len, 2)
          # valid_length (num_parallel_samples, batch_size)
  
          # sample until enough point process trajectories are collected
          if num_samples:
              num_collected_samples = outputs.shape[0]
              collected_samples, collected_vls = [outputs], [
                  valid_length
              ]
              while num_collected_samples < num_samples:
                  outputs, valid_length = (
                      x.asnumpy() for x in prediction_net(*inputs)
                  )
  
                  collected_samples.append(outputs)
                  collected_vls.append(valid_length)
  
                  num_collected_samples += outputs.shape[0]
  
              outputs = np.concatenate(collected_samples)[:num_samples]
              valid_length = np.concatenate(collected_vls)[:num_samples]
              # outputs (num_samples, batch_size, max_seq_len, 2)
              # valid_length (num_samples, batch_size)
  
              assert outputs.shape[0] == num_samples
              assert valid_length.shape[0] == num_samples
  
          assert outputs.ndim == 4
          assert valid_length.ndim == 2
  
          batch_size = outputs.shape[1]
          for i in range(batch_size):
              yield PointProcessSampleForecast(
                  outputs[:, i],
                  valid_length=valid_length[:, i],
                  start_date=batch["forecast_start"][i],
                  freq=freq,
                  prediction_interval_length=prediction_net.prediction_interval_length,  # noqa: E501
                  item_id=batch["item_id"][i]
                  if "item_id" in batch
                  else None,
                  info=batch["info"][i] if "info" in batch else None,
              )
  
imports: from functools import partial
  from pathlib import Path
  from typing import Iterator, List, Optional, cast, Type
  import mxnet
  import numpy
  from gluonts.dataset.common import Dataset
  from gluonts.dataset.loader import DataBatch, DataLoader, InferenceDataLoader
  from gluonts.model.forecast import Forecast
  from gluonts.model.forecast_generator import ForecastGenerator
  from gluonts.model.predictor import OutputTransform
  from gluonts.mx.batchify import batchify
  from gluonts.mx.model.predictor import GluonPredictor, SymbolBlockPredictor
  from gluonts.transform import Transformation
  from .forecast import PointProcessSampleForecast
label_desc: Use image node_id 1 for calling the PointProcessForecastGenerator obj's underlying member method code with example usage: obj.__call__(inference_data_loader, prediction_net, input_names, output_transform, num_samples, freq) without return types