class_docstr: Task is the central place to define and wire up components for data processing,
  model training, metric reporting, etc. Task class has a Config class containing
  the config of each component in a descriptive way.
class_docstr_tok: ["Task","is","the","central","place","to","define","and","wire","up","components","for","data","processing",",","model","training",",","metric","reporting",",","etc",".","Task","class","has","a","Config","class","containing","the","config","of","each","component","in","a","descriptive","way","."]
docstr: Generates predictions using PyTorch model. The difference with `test()` is
  that this should be used when the the examples do not have any true
  label/target.
  
  Args:
      examples: json format examples, input names should match the names specified
          in this task's features config
docstr_tok: ["Generates","predictions","using","PyTorch","model",".","The","difference","with","`","test","(",")","`","is","that","this","should","be","used","when","the","the","examples","do","not","have","any","true","label\/target",".","Args",":","examples",":","json","format","examples",",","input","names","should","match","the","names","specified","in","this","task","'s","features","config"]
code: def predict(self, examples):
      """
      Generates predictions using PyTorch model. The difference with `test()` is
      that this should be used when the the examples do not have any true
      label/target.
  
      Args:
          examples: json format examples, input names should match the names specified
              in this task's features config
      """
      self.model.eval()
      model_inputs, context = self.data_handler.get_predict_iter(
          examples
      )
      predictions, scores = self.model.get_pred(
          self.model(*model_inputs)
      )
      results: List = [None] * len(predictions)
      # rearrange to orignal order
      for idx, result in zip(
          context[BatchContext.INDEX],
          self.format_prediction(
              predictions,
              scores,
              context,
              self.data_handler.metadata.target,
          ),
      ):
          results[idx] = result
      return results
  
imports: from typing import List, Optional
  from pytext.common.constants import BatchContext
  from pytext.config import ConfigBase
  from pytext.config.component import Component, ComponentType, create_component, create_data_handler, create_exporter, create_featurizer, create_metric_reporter, create_model, create_trainer
  from pytext.config.field_config import FeatureConfig
  from pytext.data import DataHandler
  from pytext.data.featurizer import Featurizer, SimpleFeaturizer
  from pytext.exporters import ModelExporter
  from pytext.loss import KLDivergenceBCELoss, KLDivergenceCELoss
  from pytext.metric_reporters import MetricReporter
  from pytext.models import Model
  from pytext.trainers import Trainer
  from pytext.utils import cuda
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 7 for calling the TaskBase obj's underlying member method code with example usage: obj.predict(examples) and returns: results