parameters: (self, features, update_statistics=True)
docstring: Create any ops needed to provide input statistics.
  
      Should be called before statistics are requested.
  
      Args:
        features: A dictionary, the output of a `TimeSeriesInputFn` (with keys
            TrainEvalFeatures.TIMES and TrainEvalFeatures.VALUES).
        update_statistics: Whether `features` should be used to update adaptive
            statistics. Typically True for training and false for evaluation.
      Returns:
        An InputStatistics object composed of Variables, which will be updated
        based on mini-batches of data if requested.
docstring_summary: Create any ops needed to provide input statistics.
docstring_tokens: Create any ops needed to provide input statistics .
function: def initialize_graph(self, features, update_statistics=True):
      """Create any ops needed to provide input statistics.
  
      Should be called before statistics are requested.
  
      Args:
        features: A dictionary, the output of a `TimeSeriesInputFn` (with keys
            TrainEvalFeatures.TIMES and TrainEvalFeatures.VALUES).
        update_statistics: Whether `features` should be used to update adaptive
            statistics. Typically True for training and false for evaluation.
      Returns:
        An InputStatistics object composed of Variables, which will be updated
        based on mini-batches of data if requested.
      """
      if (TrainEvalFeatures.TIMES in features
          and TrainEvalFeatures.VALUES in features):
        times = features[TrainEvalFeatures.TIMES]
        values = features[TrainEvalFeatures.VALUES]
      else:
        # times and values may not be available, for example during prediction. We
        # still need to retrieve our variables so that they can be read from, even
        # if we're not going to update them.
        times = None
        values = None
      # Create/retrieve variables representing input statistics, initialized
      # without data to avoid deadlocking if variables are initialized before
      # queue runners are started.
      with variable_scope.variable_scope("input_statistics", use_resource=True):
        statistics = self._create_variable_statistics_object()
      with variable_scope.variable_scope(
          "input_statistics_auxiliary", use_resource=True):
        # Secondary statistics, necessary for the incremental computation of the
        # primary statistics (e.g. counts and sums for computing a mean
        # incrementally).
        auxiliary_variables = self._AdaptiveInputAuxiliaryStatistics(
            num_features=self._num_features, dtype=self._dtype)
      if update_statistics and times is not None and values is not None:
        # If we have times and values from mini-batch input, create update ops to
        # take the new data into account.
        assign_op = self._update_statistics_from_mini_batch(
            statistics, auxiliary_variables, times, values)
        with ops.control_dependencies([assign_op]):
          stat_variables = nest.pack_sequence_as(statistics, [
              array_ops.identity(tensor) for tensor in nest.flatten(statistics)
          ])
          # Since start time updates have a race condition, ensure that the
          # reported start time is at least as low as the lowest time in this
          # mini-batch. The start time should converge on the correct value
          # eventually even with the race condition, but for example state space
          # models have an assertion which could fail without this
          # post-processing.
          return stat_variables._replace(start_time=gen_math_ops.minimum(
              stat_variables.start_time, math_ops.reduce_min(times)))
      else:
        return statistics
function_tokens: def initialize_graph ( self , features , update_statistics = True ) : if ( TrainEvalFeatures . TIMES in features and TrainEvalFeatures . VALUES in features ) : times = features [ TrainEvalFeatures . TIMES ] values = features [ TrainEvalFeatures . VALUES ] else : # times and values may not be available, for example during prediction. We # still need to retrieve our variables so that they can be read from, even # if we're not going to update them. times = None values = None # Create/retrieve variables representing input statistics, initialized # without data to avoid deadlocking if variables are initialized before # queue runners are started. with variable_scope . variable_scope ( "input_statistics" , use_resource = True ) : statistics = self . _create_variable_statistics_object ( ) with variable_scope . variable_scope ( "input_statistics_auxiliary" , use_resource = True ) : # Secondary statistics, necessary for the incremental computation of the # primary statistics (e.g. counts and sums for computing a mean # incrementally). auxiliary_variables = self . _AdaptiveInputAuxiliaryStatistics ( num_features = self . _num_features , dtype = self . _dtype ) if update_statistics and times is not None and values is not None : # If we have times and values from mini-batch input, create update ops to # take the new data into account. assign_op = self . _update_statistics_from_mini_batch ( statistics , auxiliary_variables , times , values ) with ops . control_dependencies ( [ assign_op ] ) : stat_variables = nest . pack_sequence_as ( statistics , [ array_ops . identity ( tensor ) for tensor in nest . flatten ( statistics ) ] ) # Since start time updates have a race condition, ensure that the # reported start time is at least as low as the lowest time in this # mini-batch. The start time should converge on the correct value # eventually even with the race condition, but for example state space # models have an assertion which could fail without this # post-processing. return stat_variables . _replace ( start_time = gen_math_ops . minimum ( stat_variables . start_time , math_ops . reduce_min ( times ) ) ) else : return statistics