def _predict_and_return_dict(self, ensemble_handle, ensemble_stamp, mode):
    'Runs prediction and returns a dictionary of the prediction results.\n\n    Args:\n      ensemble_handle: ensemble resource handle.\n      ensemble_stamp: stamp of ensemble resource.\n      mode: learn.ModeKeys.TRAIN or EVAL or INFER.\n\n    Returns:\n      a dictionary of prediction results -\n        ENSEMBLE_STAMP, PREDICTION, PARTITION_IDS,\n        NUM_LAYER_ATTEMPTED, NUM_TREES_ATTEMPTED.\n    '
    ensemble_stats = training_ops.tree_ensemble_stats(ensemble_handle, ensemble_stamp)
    num_handlers = ((len(self._dense_floats) + len(self._sparse_float_shapes)) + len(self._sparse_int_shapes))
    used_handlers = model_ops.tree_ensemble_used_handlers(ensemble_handle, ensemble_stamp, num_all_handlers=num_handlers)
    (apply_dropout, seed) = _dropout_params(mode, ensemble_stats)
    with ops.control_dependencies(ensemble_stats):
        leaf_index = None
        if (self._output_leaf_index and (mode in self._output_leaf_index_modes)):
            (predictions, _, leaf_index) = prediction_ops.gradient_trees_prediction_verbose(ensemble_handle, seed, self._dense_floats, self._sparse_float_indices, self._sparse_float_values, self._sparse_float_shapes, self._sparse_int_indices, self._sparse_int_values, self._sparse_int_shapes, learner_config=self._learner_config_serialized, apply_dropout=apply_dropout, apply_averaging=(mode != learn.ModeKeys.TRAIN), use_locking=True, center_bias=self._center_bias, reduce_dim=self._reduce_dim)
        else:
            leaf_index = None
            (predictions, _) = prediction_ops.gradient_trees_prediction(ensemble_handle, seed, self._dense_floats, self._sparse_float_indices, self._sparse_float_values, self._sparse_float_shapes, self._sparse_int_indices, self._sparse_int_values, self._sparse_int_shapes, learner_config=self._learner_config_serialized, apply_dropout=apply_dropout, apply_averaging=(mode != learn.ModeKeys.TRAIN), use_locking=True, center_bias=self._center_bias, reduce_dim=self._reduce_dim)
        partition_ids = prediction_ops.gradient_trees_partition_examples(ensemble_handle, self._dense_floats, self._sparse_float_indices, self._sparse_float_values, self._sparse_float_shapes, self._sparse_int_indices, self._sparse_int_values, self._sparse_int_shapes, use_locking=True)
    return _make_predictions_dict(ensemble_stamp, predictions, partition_ids, ensemble_stats, used_handlers, leaf_index)
Runs prediction and returns a dictionary of the prediction results.

Args:
  ensemble_handle: ensemble resource handle.
  ensemble_stamp: stamp of ensemble resource.
  mode: learn.ModeKeys.TRAIN or EVAL or INFER.

Returns:
  a dictionary of prediction results -
    ENSEMBLE_STAMP, PREDICTION, PARTITION_IDS,
    NUM_LAYER_ATTEMPTED, NUM_TREES_ATTEMPTED.
def _predict_and_return_dict(self, ensemble_handle, ensemble_stamp, mode):
    'Runs prediction and returns a dictionary of the prediction results.\n\n    Args:\n      ensemble_handle: ensemble resource handle.\n      ensemble_stamp: stamp of ensemble resource.\n      mode: learn.ModeKeys.TRAIN or EVAL or INFER.\n\n    Returns:\n      a dictionary of prediction results -\n        ENSEMBLE_STAMP, PREDICTION, PARTITION_IDS,\n        NUM_LAYER_ATTEMPTED, NUM_TREES_ATTEMPTED.\n    '
    ensemble_stats = training_ops.tree_ensemble_stats(ensemble_handle, ensemble_stamp)
    num_handlers = ((len(self._dense_floats) + len(self._sparse_float_shapes)) + len(self._sparse_int_shapes))
    used_handlers = model_ops.tree_ensemble_used_handlers(ensemble_handle, ensemble_stamp, num_all_handlers=num_handlers)
    (apply_dropout, seed) = _dropout_params(mode, ensemble_stats)
    with ops.control_dependencies(ensemble_stats):
        leaf_index = None
        if (self._output_leaf_index and (mode in self._output_leaf_index_modes)):
            (predictions, _, leaf_index) = prediction_ops.gradient_trees_prediction_verbose(ensemble_handle, seed, self._dense_floats, self._sparse_float_indices, self._sparse_float_values, self._sparse_float_shapes, self._sparse_int_indices, self._sparse_int_values, self._sparse_int_shapes, learner_config=self._learner_config_serialized, apply_dropout=apply_dropout, apply_averaging=(mode != learn.ModeKeys.TRAIN), use_locking=True, center_bias=self._center_bias, reduce_dim=self._reduce_dim)
        else:
            leaf_index = None
            (predictions, _) = prediction_ops.gradient_trees_prediction(ensemble_handle, seed, self._dense_floats, self._sparse_float_indices, self._sparse_float_values, self._sparse_float_shapes, self._sparse_int_indices, self._sparse_int_values, self._sparse_int_shapes, learner_config=self._learner_config_serialized, apply_dropout=apply_dropout, apply_averaging=(mode != learn.ModeKeys.TRAIN), use_locking=True, center_bias=self._center_bias, reduce_dim=self._reduce_dim)
        partition_ids = prediction_ops.gradient_trees_partition_examples(ensemble_handle, self._dense_floats, self._sparse_float_indices, self._sparse_float_values, self._sparse_float_shapes, self._sparse_int_indices, self._sparse_int_values, self._sparse_int_shapes, use_locking=True)
    return _make_predictions_dict(ensemble_stamp, predictions, partition_ids, ensemble_stats, used_handlers, leaf_index)