class_docstr: A tower (Stacked ML model). Consists: logits, architecture, and layers.
docstr: Imports a tower from the given model directory and the tower's name.
  
  Args:
    phoenix_spec: The trial's `phoenix_spec_pb2.PhoenixSpec` proto.
    original_tower_name: a unique name for the tower (string) to import.
    new_tower_name: the name to give the new tower.
    model_directory: string, holds the model directory of the trial to import
      the tower from.
    new_model_directory: the model directory of the current trial.
    is_training: a boolean indicating if we are in training.
    logits_dimension: The last axis dimension of the logits.
    force_freeze: Force the imported tower to be frozen. For correctness, only
      force freeze with snapshotting (otherwise, you will freeze an
      non-trained tower).
    allow_auxiliary_head: Whether to allow constructing an auxiliary head for
      the tower if possible. Only applicable for CNNs.
    skip_initialization: does not add init variable from Phoenix. Relies on
      estimator init.
  
  Returns:
    A LogitsSpec containing the main and auxiliary logits and the architecture
    of the underlying tower.
docstr_tok: ["Imports","a","tower","from","the","given","model","directory","and","the","tower","'s","name",".","Args",":","phoenix_spec",":","The","trial","'s","`","phoenix_spec_pb2.PhoenixSpec","`","proto",".","original_tower_name",":","a","unique","name","for","the","tower","(","string",")","to","import",".","new_tower_name",":","the","name","to","give","the","new","tower",".","model_directory",":","string",",","holds","the","model","directory","of","the","trial","to","import","the","tower","from",".","new_model_directory",":","the","model","directory","of","the","current","trial",".","is_training",":","a","boolean","indicating","if","we","are","in","training",".","logits_dimension",":","The","last","axis","dimension","of","the","logits",".","force_freeze",":","Force","the","imported","tower","to","be","frozen",".","For","correctness",",","only","force","freeze","with","snapshotting","(","otherwise",",","you","will","freeze","an","non-trained","tower",")",".","allow_auxiliary_head",":","Whether","to","allow","constructing","an","auxiliary","head","for","the","tower","if","possible",".","Only","applicable","for","CNNs",".","skip_initialization",":","does","not","add","init","variable","from","Phoenix",".","Relies","on","estimator","init",".","Returns",":","A","LogitsSpec","containing","the","main","and","auxiliary","logits","and","the","architecture","of","the","underlying","tower","."]
code: def load(
      phoenix_spec,
      original_tower_name,
      new_tower_name,
      model_directory,
      new_model_directory,
      is_training,
      logits_dimension,
      force_freeze=False,
      allow_auxiliary_head=False,
      skip_initialization=False,
  ):
      """Imports a tower from the given model directory and the tower's name.
  
      Args:
        phoenix_spec: The trial's `phoenix_spec_pb2.PhoenixSpec` proto.
        original_tower_name: a unique name for the tower (string) to import.
        new_tower_name: the name to give the new tower.
        model_directory: string, holds the model directory of the trial to import
          the tower from.
        new_model_directory: the model directory of the current trial.
        is_training: a boolean indicating if we are in training.
        logits_dimension: The last axis dimension of the logits.
        force_freeze: Force the imported tower to be frozen. For correctness, only
          force freeze with snapshotting (otherwise, you will freeze an
          non-trained tower).
        allow_auxiliary_head: Whether to allow constructing an auxiliary head for
          the tower if possible. Only applicable for CNNs.
        skip_initialization: does not add init variable from Phoenix. Relies on
          estimator init.
  
      Returns:
        A LogitsSpec containing the main and auxiliary logits and the architecture
        of the underlying tower.
      """
      initial_architecture = architecture_utils.get_architecture(
          model_directory, original_tower_name
      )
      dropout_rate = architecture_utils.get_parameter(
          model_directory,
          original_tower_name,
          architecture_utils.DROPOUTS,
      )
      is_frozen = architecture_utils.get_parameter(
          model_directory,
          original_tower_name,
          architecture_utils.IS_FROZEN,
      )
      hparams = architecture_utils.get_hparams_from_dir(
          model_directory, original_tower_name
      )
  
      tower_spec = Tower(
          phoenix_spec=phoenix_spec,
          tower_name=new_tower_name,
          architecture=initial_architecture,
          is_training=is_training,
          logits_dimension=logits_dimension,
          dropout_rate=dropout_rate,
          hparams=hparams,
          model_directory=new_model_directory,
          is_frozen=(is_frozen or force_freeze),
          allow_auxiliary_head=allow_auxiliary_head,
      )
  
      if not skip_initialization:
          tower_spec.add_initialization(
              prev_model_dir=model_directory,
              prev_tower_name=original_tower_name,
          )
      return tower_spec
  
file_path: model_search/model_search/architecture/tower.py
imports: from model_search.architecture import architecture_utils
  import tensorflow.compat.v2
label_desc: Use image node_id 12 for calling the Tower obj's underlying member method code with example usage: obj.load(phoenix_spec, original_tower_name, new_tower_name, model_directory, new_model_directory, is_training, logits_dimension, force_freeze, allow_auxiliary_head, skip_initialization) and returns: tower_spec