code: def _create_if(cls, init_model, pred_model, n, opset_version):
      ops = cls._create_control_op(
          init_model, pred_model, n, opset_version
      )
      assert ops[0][0].type == "If"
      if_op = ops[0][0]
      then_net = else_net = None
      control_inputs = []
      for arg in if_op.arg:
          if arg.name == "then_net":
              then_net = arg.n
          if arg.name == "else_net":
              else_net = arg.n
          if arg.name == "__control_inputs":
              control_inputs = arg.strings
  
      assert then_net and else_net
      then_net_outs = then_net.external_output
      else_net_outs = else_net.external_output
      op_outputs = if_op.output
      assert len(then_net_outs) == len(else_net_outs)
      assert len(else_net_outs) == len(op_outputs)
  
      for arg in if_op.arg:
          if arg.name == "then_net":
              arg.n.external_input.extend(control_inputs)
          if arg.name == "else_net":
              arg.n.external_input.extend(control_inputs)
  
      return ops
  
imports: import collections
  import sys
  import zipfile
  import itertools
  import onnx.backend
  from caffe2.python import core, workspace, rnn_cell, gru_cell
  from caffe2.python.model_helper import ModelHelper
  from caffe2.proto import caffe2_pb2
  import caffe2.python.utils
  import numpy
  import onnx
  from onnx import TensorProto
  import onnx.numpy_helper
  import onnx.defs
  import onnx.shape_inference
  import onnx.utils
  from onnx.backend.base import Backend, Device, DeviceType, namedtupledict
  from caffe2.python.onnx.workspace import Workspace
  from caffe2.python.onnx.backend_rep import Caffe2Rep
  import caffe2.python._import_c_extension
  import warnings
label_desc: Use image node_id 9 for calling the Caffe2Backend obj's underlying member method code with example usage: obj._create_if(cls, init_model, pred_model, n, opset_version) and returns: ops