class_docstr: Generates TaskSpecs for various tasks in Phoenix.
docstr: Helper function to get the various logits for a task.
docstr_tok: ["Helper","function","to","get","the","various","logits","for","a","task","."]
code: def get_train_and_eval_logits(self, towers, trial_mode):
      """Helper function to get the various logits for a task."""
      priors_logits_specs = []
      search_logits_specs = []
      if base_tower_generator.SEARCH_GENERATOR in towers.keys():
          search_logits_specs = [
              t.logits_spec
              for t in towers[base_tower_generator.SEARCH_GENERATOR]
          ]
      if base_tower_generator.PRIOR_GENERATOR in towers.keys():
          priors_logits_specs = [
              t.logits_spec
              for t in towers[base_tower_generator.PRIOR_GENERATOR]
          ]
      if base_tower_generator.REPLAY_GENERATOR in towers.keys():
          priors_logits_specs = [
              t.logits_spec
              for t in towers[base_tower_generator.REPLAY_GENERATOR]
          ]
  
      teacher_logits = None
      if trial_mode == trial_utils.TrialMode.ENSEMBLE_SEARCH:
          ensemble_logits = self._ensembler.bundle_logits(
              priors_logits_specs=priors_logits_specs,
              search_logits_specs=search_logits_specs,
              logits_dimension=self._logits_dimension,
          )
      elif trial_mode == trial_utils.TrialMode.DISTILLATION:
          # TODO(b/146067345): Initialize some random architecture if search
          # logits specs is empty.
          ensemble_logits = self._distiller.bundle_logits(
              priors_logits_specs=priors_logits_specs,
              search_logits_specs=search_logits_specs,
          )
          teacher_logits = ensemble_logits.teacher_logits_spec
      else:
          ensemble_logits = EnsembleLogits(
              train_logits_specs=search_logits_specs,
              eval_logits_spec=search_logits_specs[0],
          )
      return (
          ensemble_logits.train_logits_specs,
          ensemble_logits.eval_logits_spec,
          teacher_logits,
      )
  
imports: import collections
  import functools
  import inspect
  from absl import logging
  from model_search import block_builder
  from model_search import ensembler
  from model_search.architecture import architecture_utils
  from model_search.architecture import tower
  from model_search.ensembler import EnsembleLogits
  from model_search.generators import base_tower_generator
  from model_search.generators import trial_utils
  from model_search.meta import distillation
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 4 for calling the TaskManager obj's underlying member method code with example usage: obj.get_train_and_eval_logits(towers, trial_mode) and returns: ensemble_logits,  ensemble_logits,  teacher_logits