(self, estimator_spec)
return estimator_spec
Validates the estimator_spec.
Validates the estimator_spec.
Validates the estimator_spec .
def _verify_estimator_spec(self, estimator_spec):
    """Validates the estimator_spec."""
    if isinstance(estimator_spec, model_fn_lib._TPUEstimatorSpec):  # pylint: disable=protected-access
      return estimator_spec

    err_msg = '{} returned by EstimatorSpec is not supported in TPUEstimator.'
    if estimator_spec.training_chief_hooks:
      raise ValueError(
          err_msg.format('training_chief_hooks') + 'If you want' +
          ' to pass training hooks, please pass via training_hooks.')

    if estimator_spec.scaffold:
      logging.warning('EstimatorSpec.Scaffold is ignored by TPU train/eval. '
                      'Please use TPUEstimatorSpec.')
    return estimator_spec
def _verify_estimator_spec ( self , estimator_spec ) : if isinstance ( estimator_spec , model_fn_lib . _TPUEstimatorSpec ) : # pylint: disable=protected-access return estimator_spec err_msg = '{} returned by EstimatorSpec is not supported in TPUEstimator.' if estimator_spec . training_chief_hooks : raise ValueError ( err_msg . format ( 'training_chief_hooks' ) + 'If you want' + ' to pass training hooks, please pass via training_hooks.' ) if estimator_spec . scaffold : logging . warning ( 'EstimatorSpec.Scaffold is ignored by TPU train/eval. ' 'Please use TPUEstimatorSpec.' ) return estimator_spec