code: def hybrid_block_to_symbol_block(
      hb: mx.gluon.HybridBlock, data_batch: List[mx.nd.NDArray]
  ) -> mx.gluon.SymbolBlock:
      """
      Converts a Gluon `HybridBlock` to a `SymbolBlock`. Following the Gluon API,
      this is achieved by a `hybridize()` call on the passed `HybridBlock`, a
      single forward pass (using the provided data batch), and a combination of
      an `export()` and an `import()` calls of the input block.
  
      Note that MXNet has `problems with this method
      <https://github.com/apache/incubator-mxnet/issues/12783>`_.
  
      Parameters
      ----------
      hb
          The Gluon `HybridBlock` to convert.
      data_batch
          Data to use for the forward pass after the `hybridize()` call.
  
      Returns
      -------
      mx.gluon.SymbolBlock
          The resulting Gluon block backed by an MXNet symbol graph.
      """
      with tempfile.TemporaryDirectory(
          prefix="gluonts-estimator-temp-"
      ) as model_dir:
          # when importing, SymbolBlock has to know about the total number
          # of input symbols, including nested Tensors
          flat_data_batch, _ = _flatten(data_batch, "input")
          num_inputs = len(flat_data_batch)
  
          model_dir_path = Path(model_dir)
          model_name = "gluonts-model"
  
          with HybridContext(
              net=hb,
              hybridize=True,
              data_batch=data_batch,
              static_alloc=True,
              static_shape=True,
          ):
              export_symb_block(hb, model_dir_path, model_name)
              sb = import_symb_block(
                  num_inputs, model_dir_path, model_name
              )
              sb(*data_batch)
  
          return sb
  
imports: import inspect
  import tempfile
  from pathlib import Path
  from typing import List, Optional, Tuple, cast, Type
  import mxnet
  from mxnet.gluon.block import _flatten
  from gluonts.core.serde import dump_json, load_json
  from gluonts.mx import Tensor
label_desc: Use image node_id 4 for calling a global function with example usage: hybrid_block_to_symbol_block(hb, data_batch) and returns: sb