class_docstr: Base class for categorical DQN net builder.
class_docstr_tok: ["Base","class","for","categorical","DQN","net","builder","."]
docstr: Returns a TorchScript predictor module
docstr_tok: ["Returns","a","TorchScript","predictor","module"]
code: def build_serving_module(
      self,
      q_network: ModelBase,
      state_normalization_data: NormalizationData,
      action_names: List[str],
      state_feature_config: rlt.ModelFeatureConfig,
  ) -> torch.nn.Module:
      """
      Returns a TorchScript predictor module
      """
      state_preprocessor = Preprocessor(
          state_normalization_data.dense_normalization_parameters, False
      )
      dqn_with_preprocessor = DiscreteDqnWithPreprocessor(
          q_network.cpu_model().eval(),
          state_preprocessor,
          state_feature_config,
      )
      return DiscreteDqnPredictorWrapper(
          dqn_with_preprocessor, action_names, state_feature_config
      )
  
file_path: ReAgent/reagent/net_builder/categorical_dqn_net_builder.py
imports: import abc
  from typing import List
  import reagent.core.types
  import torch
  from reagent.core.fb_checker import IS_FB_ENVIRONMENT
  from reagent.core.parameters import NormalizationData
  from reagent.models.base import ModelBase
  from reagent.prediction.predictor_wrapper import DiscreteDqnWithPreprocessor
  from reagent.preprocessing.normalization import get_num_output_features
  from reagent.preprocessing.preprocessor import Preprocessor
label_desc: Use image node_id 3 for calling the CategoricalDQNNetBuilder obj's underlying member method code with example usage: obj.build_serving_module(q_network, state_normalization_data, action_names, state_feature_config) and returns: DiscreteDqnPredictorWrapper