class_docstr: Classification model.
  
  Subclasses must set the following attributes:
    output: logits op(s) used for computing classification loss and predicted
      class probabilities for each task.
class_docstr_tok: ["Classification","model",".","Subclasses","must","set","the","following","attributes",":","output",":","logits","op","(","s",")","used","for","computing","classification","loss","and","predicted","class","probabilities","for","each","task","."]
docstr: Return model output for the provided input.
  
  Restore(checkpoint) must have previously been called on this object.
  
  Args:
    dataset: dc.data.dataset object.
  
  Returns:
    Tuple of three numpy arrays with shape n_examples x n_tasks (x ...):
      output: Model outputs.
      labels: True labels.
      weights: Example weights.
    Note that the output and labels arrays may be more than 2D, e.g. for
    classifier models that return class probabilities.
  
  Raises:
    AssertionError: If model is not in evaluation mode.
    ValueError: If output and labels are not both 3D or both 2D.
docstr_tok: ["Return","model","output","for","the","provided","input",".","Restore","(","checkpoint",")","must","have","previously","been","called","on","this","object",".","Args",":","dataset",":","dc.data.dataset","object",".","Returns",":","Tuple","of","three","numpy","arrays","with","shape","n_examples","x","n_tasks","(","x","...",")",":","output",":","Model","outputs",".","labels",":","True","labels",".","weights",":","Example","weights",".","Note","that","the","output","and","labels","arrays","may","be","more","than","2D",",","e.g",".","for","classifier","models","that","return","class","probabilities",".","Raises",":","AssertionError",":","If","model","is","not","in","evaluation","mode",".","ValueError",":","If","output","and","labels","are","not","both","3D","or","both","2D","."]
code: def predict_on_batch(self, X):
      """Return model output for the provided input.
  
      Restore(checkpoint) must have previously been called on this object.
  
      Args:
        dataset: dc.data.dataset object.
  
      Returns:
        Tuple of three numpy arrays with shape n_examples x n_tasks (x ...):
          output: Model outputs.
          labels: True labels.
          weights: Example weights.
        Note that the output and labels arrays may be more than 2D, e.g. for
        classifier models that return class probabilities.
  
      Raises:
        AssertionError: If model is not in evaluation mode.
        ValueError: If output and labels are not both 3D or both 2D.
      """
      len_unpadded = len(X)
      if self.pad_batches:
          X = pad_features(self.batch_size, X)
  
      if not self._restored_model:
          self.restore()
      with self.eval_graph.graph.as_default():
          # run eval data through the model
          n_tasks = self.n_tasks
          output = []
          with self._get_shared_session(train=False).as_default():
              feed_dict = self.construct_feed_dict(X)
              data = self._get_shared_session(train=False).run(
                  self.eval_graph.output, feed_dict=feed_dict
              )
              batch_output = np.asarray(data[:n_tasks], dtype=float)
              # reshape to batch_size x n_tasks x ...
              if batch_output.ndim == 3:
                  batch_output = batch_output.transpose((1, 0, 2))
              elif batch_output.ndim == 2:
                  batch_output = batch_output.transpose((1, 0))
              else:
                  raise ValueError(
                      "Unrecognized rank combination for output: %s"
                      % (batch_output.shape,)
                  )
              output.append(batch_output)
  
              outputs = np.array(
                  from_one_hot(
                      np.squeeze(np.concatenate(output)), axis=-1
                  )
              )
  
      outputs = np.copy(outputs)
      outputs = np.reshape(outputs, (len(X), n_tasks))
      outputs = outputs[:len_unpadded]
      return outputs
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import unicode_literals
  import collections
  import pickle
  import os
  import time
  import warnings
  import numpy
  import pandas
  import tensorflow
  import tempfile
  from deepchem.models import Model
  from deepchem.metrics import from_one_hot
  from deepchem.nn import model_ops
  from deepchem.models.tensorflow_models import utils
  from deepchem.trans import undo_transforms
  from deepchem.utils.save import log
  from deepchem.utils.evaluate import Evaluator
  from deepchem.data import pad_features
  from tensorflow.contrib.layers.python.layers import batch_norm
label_desc: Use image node_id 4 for calling the TensorflowClassifier obj's underlying member method code with example usage: obj.predict_on_batch(X) and returns: outputs