code: def darts_mode(
      mutable_id,
      mutable_layer_id,
      funcs,
      funcs_args,
      fixed_inputs,
      optional_inputs,
      optional_input_size,
      tf,
  ):
      optional_inputs = list(optional_inputs.values())
      layer_outs = [
          func([fixed_inputs, optional_inputs], **funcs_args[func_name])
          for func_name, func in funcs.items()
      ]
      # Create architecture weights for every func(op)
      var_name = "{}_{}_arch_weights".format(
          mutable_id, mutable_layer_id
      )
      arch_logits = tf.get_variable(
          var_name, shape=[len(funcs)], trainable=False
      )
      _arch_logits_list.append(arch_logits)
      arch_weights = tf.nn.softmax(arch_logits)
      layer_out = tf.add_n(
          [
              arch_weights[idx] * out
              for idx, out in enumerate(layer_outs)
          ]
      )
  
      return layer_out
  
file_path: nni/nni/common/nas_utils.py
imports: import functools
  import logging
  from ..None import trial
label_desc: Use image node_id 4 for calling a global function with example usage: darts_mode(mutable_id, mutable_layer_id, funcs, funcs_args, fixed_inputs, optional_inputs, optional_input_size, tf) and returns: layer_out