class_docstr: Helper class to understand Replay state.
class_docstr_tok: ["Helper","class","to","understand","Replay","state","."]
docstr: Returns True if we are training a new tower in a replay run.
  
  Example:
    1. In adaptive ensembling, every trial is training one new tower, so the
    return value is always True.
    2. In a non-adaptive ensembling, every trial except the last one is
    training a new tower, whereas the last trial just ensembles the trained
    towers.
  
  Args:
    my_id: trial id.  Returns True if we train a new tower, and False
      otherwise.
docstr_tok: ["Returns","True","if","we","are","training","a","new","tower","in","a","replay","run",".","Example",":","1",".","In","adaptive","ensembling",",","every","trial","is","training","one","new","tower",",","so","the","return","value","is","always","True",".","2",".","In","a","non-adaptive","ensembling",",","every","trial","except","the","last","one","is","training","a","new","tower",",","whereas","the","last","trial","just","ensembles","the","trained","towers",".","Args",":","my_id",":","trial","id",".","Returns","True","if","we","train","a","new","tower",",","and","False","otherwise","."]
code: def replay_is_training_a_tower(self, my_id):
      """Returns True if we are training a new tower in a replay run.
  
      Example:
        1. In adaptive ensembling, every trial is training one new tower, so the
        return value is always True.
        2. In a non-adaptive ensembling, every trial except the last one is
        training a new tower, whereas the last trial just ensembles the trained
        towers.
  
      Args:
        my_id: trial id.  Returns True if we train a new tower, and False
          otherwise.
      """
      towers_number = len(self._phoenix_spec.replay.towers)
      output = (
          trial_utils.adaptive_or_residual_ensemble(self._phoenix_spec)
          or my_id < towers_number
          or towers_number == 1
      )
      return output
  
imports: import abc
  import collections
  from absl import logging
  from model_search.architecture import architecture_utils
  from model_search.generators import base_tower_generator
  from model_search.generators import trial_utils
  from model_search.generators.prior_generator import PriorGenerator
  from model_search.generators.replay_generator import ReplayGenerator
  from model_search.generators.search_candidate_generator import SearchCandidateGenerator
label_desc: Use image node_id 4 for calling the ReplayState obj's underlying member method code with example usage: obj.replay_is_training_a_tower(my_id) and returns: output