parameters: (self, features, mode, state)
return_statement: return ModelOutputs(
          loss=per_observation_loss,
          end_state=state,
          predictions=outputs,
          prediction_times=features[TrainEvalFeatures.TIMES])
docstring: Calls self._filtering_step. See TimeSeriesModel.get_batch_loss.
docstring_summary: Calls self._filtering_step. See TimeSeriesModel.get_batch_loss.
docstring_tokens: Calls self . _filtering_step . See TimeSeriesModel . get_batch_loss .
function: def get_batch_loss(self, features, mode, state):
      """Calls self._filtering_step. See TimeSeriesModel.get_batch_loss."""
      per_observation_loss, state, outputs = self.per_step_batch_loss(
          features, mode, state)
      # per_step_batch_loss returns [batch size, window size, ...] state, whereas
      # get_batch_loss is expected to return [batch size, ...] state for the last
      # element of a window
      state = nest.pack_sequence_as(
          state,
          [state_element[:, -1] for state_element in nest.flatten(state)])
      outputs["observed"] = features[TrainEvalFeatures.VALUES]
      return ModelOutputs(
          loss=per_observation_loss,
          end_state=state,
          predictions=outputs,
          prediction_times=features[TrainEvalFeatures.TIMES])
function_tokens: def get_batch_loss ( self , features , mode , state ) : per_observation_loss , state , outputs = self . per_step_batch_loss ( features , mode , state ) # per_step_batch_loss returns [batch size, window size, ...] state, whereas # get_batch_loss is expected to return [batch size, ...] state for the last # element of a window state = nest . pack_sequence_as ( state , [ state_element [ : , - 1 ] for state_element in nest . flatten ( state ) ] ) outputs [ "observed" ] = features [ TrainEvalFeatures . VALUES ] return ModelOutputs ( loss = per_observation_loss , end_state = state , predictions = outputs , prediction_times = features [ TrainEvalFeatures . TIMES ] )