docstr: Use a model to do prediction.
  
  # Arguments
  x: Prediction data. A Numpy array or RDD of Sample or ImageSet.
  batch_per_thread:
    The default value is 4.
    When distributed is True,the total batch size is batch_per_thread * rdd.getNumPartitions.
    When distributed is False the total batch size is batch_per_thread * numOfCores.
  distributed: Boolean. Whether to do prediction in distributed mode or local mode.
               Default is True. In local mode, x must be a Numpy array.
docstr_tok: ["Use","a","model","to","do","prediction",".","#","Arguments","x",":","Prediction","data",".","A","Numpy","array","or","RDD","of","Sample","or","ImageSet",".","batch_per_thread",":","The","default","value","is","4",".","When","distributed","is","True",",","the","total","batch","size","is","batch_per_thread","*","rdd.getNumPartitions",".","When","distributed","is","False","the","total","batch","size","is","batch_per_thread","*","numOfCores",".","distributed",":","Boolean",".","Whether","to","do","prediction","in","distributed","mode","or","local","mode",".","Default","is","True",".","In","local","mode",",","x","must","be","a","Numpy","array","."]
code: def predict(self, x, batch_per_thread=4, distributed=True):
      """
      Use a model to do prediction.
  
      # Arguments
      x: Prediction data. A Numpy array or RDD of Sample or ImageSet.
      batch_per_thread:
        The default value is 4.
        When distributed is True,the total batch size is batch_per_thread * rdd.getNumPartitions.
        When distributed is False the total batch size is batch_per_thread * numOfCores.
      distributed: Boolean. Whether to do prediction in distributed mode or local mode.
                   Default is True. In local mode, x must be a Numpy array.
      """
      if isinstance(x, ImageSet) or isinstance(x, TextSet):
          results = callZooFunc(
              self.bigdl_type,
              "zooPredict",
              self.value,
              x,
              batch_per_thread,
          )
          return (
              ImageSet(results)
              if isinstance(x, ImageSet)
              else TextSet(results)
          )
      if distributed:
          if isinstance(x, np.ndarray):
              data_rdd = to_sample_rdd(x, np.zeros([x.shape[0]]))
          elif isinstance(x, RDD):
              data_rdd = x
          else:
              raise TypeError(
                  "Unsupported prediction data type: %s" % type(x)
              )
          results = callZooFunc(
              self.bigdl_type,
              "zooPredict",
              self.value,
              data_rdd,
              batch_per_thread,
          )
          return results.map(
              lambda result: Layer.convert_output(result)
          )
      else:
          if isinstance(x, np.ndarray) or isinstance(x, list):
              results = callZooFunc(
                  self.bigdl_type,
                  "zooPredict",
                  self.value,
                  self._to_jtensors(x),
                  batch_per_thread,
              )
              return [
                  Layer.convert_output(result) for result in results
              ]
          else:
              raise TypeError(
                  "Unsupported prediction data type: %s" % type(x)
              )
  
imports: import zoo.pipeline.api.autograd
  from zoo.feature.image import ImageSet
  from zoo.feature.text import TextSet
  from zoo.feature.common import FeatureSet
  from zoo.pipeline.api.keras.base import ZooKerasLayer
  from zoo.pipeline.api.keras.utils import *
  from bigdl.nn.layer import Layer
  from zoo.common.utils import callZooFunc
label_desc: Use image node_id 16 for calling the KerasNet obj's underlying member method code with example usage: obj.predict(x, batch_per_thread, distributed) and returns: unknown, results, unknown