code: def reload_tensorflow_variables(tf, session):
      """In Enas mode, this function reload every signal varaible created in `enas_mode` function so
      the whole tensorflow graph will be changed into certain subgraph recerived from Tuner.
      ---------------
      session: the tensorflow session created by users
      tf: tensorflow module
      """
      subgraph_from_tuner = trial.get_next_parameter()
      mutable_layers = set()
      for subgraph_key in subgraph_from_tuner:
          if "/" in subgraph_key:
              # has to remove the last, could be layer_choice or whatever
              mutable_id, mutable_layer_id = _decompose_general_key(
                  subgraph_key[: subgraph_key.rfind("/")]
              )
              if mutable_id is not None:
                  mutable_layers.add((mutable_id, mutable_layer_id))
      mutable_layers = sorted(list(mutable_layers))
      for mutable_id, mutable_layer_id in mutable_layers:
          if mutable_id not in _namespace:
              _logger.warning("%s not found in name space", mutable_id)
              continue
          name_prefix = "{}_{}".format(mutable_id, mutable_layer_id)
          # get optional inputs names
          optional_inputs = _namespace[name_prefix]["optional_inputs"]
          # extract layer information from the subgraph sampled by tuner
          (
              chosen_layer,
              chosen_inputs,
          ) = _get_layer_and_inputs_from_tuner(
              mutable_id, mutable_layer_id, optional_inputs
          )
          chosen_layer = _namespace[name_prefix]["funcs"].index(
              chosen_layer
          )
          chosen_inputs = [
              1 if inp in chosen_inputs else 0
              for inp in optional_inputs
          ]
          # load these information into pre-defined tensorflow variables
          _tf_variables[name_prefix]["funcs"].load(
              chosen_layer, session
          )
          _tf_variables[name_prefix]["optional_inputs"].load(
              chosen_inputs, session
          )
  
file_path: nni/nni/common/nas_utils.py
imports: import functools
  import logging
  from ..None import trial
label_desc: Use image node_id 5 for calling a global function with example usage: reload_tensorflow_variables(tf, session) without return types