class_docstr: .. note:: `bigdl.dllib.keras` is deprecated in 0.11.
  This will be removed in future releases.
class_docstr_tok: ["..","note",":",":","`","bigdl.dllib.keras","`","is","deprecated","in","0.11",".","This","will","be","removed","in","future","releases","."]
docstr: Use a model to do prediction.
  
  # Arguments
  x: Input data. A Numpy array or RDD of Sample.
  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",":","Input","data",".","A","Numpy","array","or","RDD","of","Sample",".","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, distributed=True):
      """
      Use a model to do prediction.
  
      # Arguments
      x: Input data. A Numpy array or RDD of Sample.
      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 is_distributed:
          if isinstance(x, np.ndarray):
              features = to_sample_rdd(x, np.zeros([x.shape[0]]))
          elif isinstance(x, RDD):
              features = x
          else:
              invalidInputError(
                  False,
                  "Unsupported prediction data type: %s" % type(x),
              )
          return self.predict_distributed(features)
      else:
          if isinstance(x, np.ndarray):
              return self.predict_local(x)
          else:
              invalidInputError(
                  False,
                  "Unsupported prediction data type: %s" % type(x),
              )
  
imports: from bigdl.dllib.nn.keras.layers.layer import KerasLayer
  from bigdl.dllib.optim.optimizer import *
  from bigdl.dllib.nn.criterion import *
  from bigdl.dllib.utils.log4Error import *
  import multiprocessing
  import warnings
  from bigdl.dllib.nn.layer import SharedStaticUtils, Container
label_desc: Use image node_id 7 for calling the KerasModel obj's underlying member method code with example usage: obj.predict(x, distributed) and returns: self, self