class_docstr: A predictor which serializes the network structure using the JSON-
  serialization methods located in `gluonts.core.serde`. Use the following
  logic to create a `RepresentableBlockPredictor` from a trained prediction
  network.
  
  >>> def create_representable_block_predictor(
  ...        prediction_network: mx.gluon.HybridBlock,
  ...        **kwargs
  ... ) -> RepresentableBlockPredictor:
  ...    return RepresentableBlockPredictor(
  ...        prediction_net=prediction_network,
  ...        **kwargs
  ...    )
class_docstr_tok: ["A","predictor","which","serializes","the","network","structure","using","the","JSON-","serialization","methods","located","in","`","gluonts.core.serde","`",".","Use","the","following","logic","to","create","a","`","RepresentableBlockPredictor","`","from","a","trained","prediction","network",".",">",">",">","def","create_representable_block_predictor","(","...","prediction_network",":","mx.gluon.HybridBlock",",","...","*","*","kwargs","...",")","-",">","RepresentableBlockPredictor",":","...","return","RepresentableBlockPredictor","(","...","prediction_net=prediction_network",",","...","*","*","kwargs","...",")"]
code: def as_symbol_block_predictor(
      self,
      batch: Optional[DataBatch] = None,
      dataset: Optional[Dataset] = None,
  ) -> SymbolBlockPredictor:
      if batch is None:
          assert dataset is not None
          data_loader = InferenceDataLoader(
              dataset,
              transform=self.input_transform,
              batch_size=self.batch_size,
              stack_fn=partial(
                  batchify, ctx=self.ctx, dtype=self.dtype
              ),
          )
          batch = next(iter(data_loader))
  
      with self.ctx:
          symbol_block_net = hybrid_block_to_symbol_block(
              hb=self.prediction_net,
              data_batch=[batch[k] for k in self.input_names],
          )
  
      return SymbolBlockPredictor(
          input_names=self.input_names,
          prediction_net=symbol_block_net,
          batch_size=self.batch_size,
          prediction_length=self.prediction_length,
          ctx=self.ctx,
          input_transform=self.input_transform,
          lead_time=self.lead_time,
          forecast_generator=self.forecast_generator,
          output_transform=self.output_transform,
          dtype=self.dtype,
      )
  
imports: import logging
  from functools import partial
  from pathlib import Path
  from typing import Callable, Iterator, List, Optional, Type
  import mxnet
  import numpy
  from gluonts.core.serde import dump_json, load_json
  from gluonts.dataset.common import DataEntry, Dataset
  from gluonts.dataset.loader import DataBatch, InferenceDataLoader
  from gluonts.model.forecast import Forecast
  from gluonts.model.forecast_generator import ForecastGenerator, SampleForecastGenerator, to_numpy
  from gluonts.model.predictor import OutputTransform, Predictor
  from gluonts.mx.batchify import batchify
  from gluonts.mx.component import equals
  from gluonts.mx.context import get_mxnet_context
  from gluonts.mx.util import export_repr_block, export_symb_block, get_hybrid_forward_input_names, hybrid_block_to_symbol_block, import_repr_block, import_symb_block
  from gluonts.transform import Transformation
label_desc: Use image node_id 2 for calling the RepresentableBlockPredictor obj's underlying member method code with example usage: obj.as_symbol_block_predictor(batch, dataset) and returns: SymbolBlockPredictor