parameters: (self, input_shapes, type_dict=None)
docstring: Initialize the predictor module for running prediction.
docstring_summary: Initialize the predictor module for running prediction.
docstring_tokens: Initialize the predictor module for running prediction .
function: def _init_predictor(self, input_shapes, type_dict=None):
          """Initialize the predictor module for running prediction."""
          shapes = {name: self.arg_params[name].shape for name in self.arg_params}
          shapes.update(dict(input_shapes))
          if self._pred_exec is not None:
              arg_shapes, _, _ = self.symbol.infer_shape(**shapes)
              assert arg_shapes is not None, "Incomplete input shapes"
              pred_shapes = [x.shape for x in self._pred_exec.arg_arrays]
              if arg_shapes == pred_shapes:
                  return
          # for now only use the first device
          pred_exec = self.symbol.simple_bind(
              self.ctx[0], grad_req='null', type_dict=type_dict, **shapes)
          pred_exec.copy_params_from(self.arg_params, self.aux_params)
  
          _check_arguments(self.symbol)
          self._pred_exec = pred_exec
function_tokens: def _init_predictor ( self , input_shapes , type_dict = None ) : shapes = { name : self . arg_params [ name ] . shape for name in self . arg_params } shapes . update ( dict ( input_shapes ) ) if self . _pred_exec is not None : arg_shapes , _ , _ = self . symbol . infer_shape ( * * shapes ) assert arg_shapes is not None , "Incomplete input shapes" pred_shapes = [ x . shape for x in self . _pred_exec . arg_arrays ] if arg_shapes == pred_shapes : return # for now only use the first device pred_exec = self . symbol . simple_bind ( self . ctx [ 0 ] , grad_req = 'null' , type_dict = type_dict , * * shapes ) pred_exec . copy_params_from ( self . arg_params , self . aux_params ) _check_arguments ( self . symbol ) self . _pred_exec = pred_exec