Esempio n. 1
0
    def restore(self, restored_tensors, unused_restored_shapes):
        """Restores the associated tree ensemble from 'restored_tensors'.

    Args:
      restored_tensors: the tensors that were loaded from a checkpoint.
      unused_restored_shapes: the shapes this object should conform to after
        restore. Not meaningful for trees.

    Returns:
      The operation that restores the state of the tree ensemble variable.
    """
        with ops.control_dependencies([self._create_op]):
            return tree_ensemble_deserialize(
                self._tree_ensemble_handle,
                stamp_token=restored_tensors[0],
                tree_ensemble_config=restored_tensors[1])
Esempio n. 2
0
  def restore(self, restored_tensors, unused_restored_shapes):
    """Restores the associated tree ensemble from 'restored_tensors'.

    Args:
      restored_tensors: the tensors that were loaded from a checkpoint.
      unused_restored_shapes: the shapes this object should conform to after
        restore. Not meaningful for trees.

    Returns:
      The operation that restores the state of the tree ensemble variable.
    """
    with ops.control_dependencies([self._create_op]):
      return tree_ensemble_deserialize(
          self._tree_ensemble_handle,
          stamp_token=restored_tensors[0],
          tree_ensemble_config=restored_tensors[1])