docstr: Test a simple if-else branch network
          
docstr_tok: ["Test","a","simple","if-else","branch","network"]
code: def test_simple_branch(self):
      """Test a simple if-else branch network"""
      input_features = [
          ("data", datatypes.Array(3)),
          ("cond", datatypes.Array(1)),
      ]
      output_features = [("output", None)]
  
      builder_top = NeuralNetworkBuilder(
          input_features,
          output_features,
          disable_rank5_shape_mapping=True,
      )
      layer = builder_top.add_branch("branch_layer", "cond")
  
      builder_ifbranch = NeuralNetworkBuilder(
          input_features=None,
          output_features=None,
          spec=None,
          nn_spec=layer.branch.ifBranch,
      )
      builder_ifbranch.add_elementwise(
          "mult_layer",
          input_names=["data"],
          output_name="output",
          mode="MULTIPLY",
          alpha=10,
      )
      builder_elsebranch = NeuralNetworkBuilder(
          input_features=None,
          output_features=None,
          spec=None,
          nn_spec=layer.branch.elseBranch,
      )
      builder_elsebranch.add_elementwise(
          "add_layer",
          input_names=["data"],
          output_name="output",
          mode="ADD",
          alpha=10,
      )
      coremltools.models.utils.save_spec(
          builder_top.spec, "/tmp/simple_branch.mlmodel"
      )
      mlmodel = MLModel(builder_top.spec)
  
      # True branch case
      input_dict = {
          "data": np.array(range(1, 4), dtype="float"),
          "cond": np.array([1], dtype="float"),
      }
      output_ref = {"output": input_dict["data"] * 10}
      self._test_model(mlmodel, input_dict, output_ref)
  
      # False branch case
      input_dict["cond"] = np.array([0], dtype="float")
      output_ref["output"] = input_dict["data"] + 10
      self._test_model(mlmodel, input_dict, output_ref)
  
imports: import numpy
  import pytest
  import unittest
  import coremltools
  from coremltools import ComputeUnit
  from coremltools.converters.mil.mil.types.type_mapping import np_val_to_py_type
  from coremltools.models import MLModel, datatypes
  from coremltools.models.neural_network import NeuralNetworkBuilder
  from coremltools.models.neural_network.quantization_utils import _convert_array_to_nbit_quantized_bytes, quantize_weights
  from coremltools.models.utils import _is_macos, _macos_version
label_desc: Use image node_id 4 for calling the ControlFlowCorrectnessTest obj's underlying member method code with example usage: obj.test_simple_branch() without return types