code: def get_arch_str_from_model(net):
      search_cell = net.stack_cell1[0].options
      keep_mask = net.stack_cell1[0].keep_mask
      num_nodes = net.stack_cell1[0].num_nodes
  
      nodes = []
      idx = 0
      for curr_node in range(num_nodes - 1):
          edges = []
          for prev_node in range(curr_node + 1):  # n-1 prev nodes
              for _op_name in OPS.keys():
                  if keep_mask[idx]:
                      edges.append(f"{_op_name}~{prev_node}")
                  idx += 1
          node_str = "|".join(edges)
          node_str = f"|{node_str}|"
          nodes.append(node_str)
      arch_str = "+".join(nodes)
      return arch_str
  
file_path: singa/examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/src/third_pkg/sp201_lib/nasbench2.py
imports: from .nasbench2_ops import *
label_desc: Use image node_id 4 for calling a global function with example usage: get_arch_str_from_model(net) and returns: arch_str