class_docstr: Return the elements selected from either ``a`` or ``b`` depending on the ``cond``.
  
  You must provide ``a``, ``b`` and ``cond``. The shape of ``cond``, ``a``,
  and ``b`` must be broadcastable.
  
  Parameters
  ----------
  cond: tensor<[\*D1], B> (Required)
      * Tensor. When ``True``, select element from ``x``, otherwise, ``y``.
  
  a: tensor<[\*D2], T> (Optional)
      * Values selected at indices where ``cond`` is ``True``.
      * Default is ``None``.
  
  b: tensor<[\*D3], T> (Optional)
      * Values selected at indices where ``cond`` is ``False``.
      * Default is ``None``.
  
  Returns
  -------
  tensor<[\*D_out], T> or tensor<[n, len(D1)], int32>
      *  If ``a, b`` are both provided, the return shape is based on broadcast rules
         from ``cond, a, b``.
      *  If ``a, b`` are ``None``, the return shape is 2-D, where the first dimension
         ``n`` is the number of matching indices in ``cond``, and ``len(D1)`` is the
         rank of ``cond``.
  
  Attributes
  ----------
  B: bool
  T: fp16, fp32, i32, bool
class_docstr_tok: ["Return","the","elements","selected","from","either","``","a","``","or","``","b","``","depending","on","the","``","cond","``",".","You","must","provide","``","a","``",",","``","b","``","and","``","cond","``",".","The","shape","of","``","cond","``",",","``","a","``",",","and","``","b","``","must","be","broadcastable",".","Parameters","--","--","--","--","--","cond",":","tensor","<","[","\\","*","D1","]",",","B",">","(","Required",")","*","Tensor",".","When","``","True","``",",","select","element","from","``","x","``",",","otherwise",",","``","y","``",".","a",":","tensor","<","[","\\","*","D2","]",",","T",">","(","Optional",")","*","Values","selected","at","indices","where","``","cond","``","is","``","True","``",".","*","Default","is","``","None","``",".","b",":","tensor","<","[","\\","*","D3","]",",","T",">","(","Optional",")","*","Values","selected","at","indices","where","``","cond","``","is","``","False","``",".","*","Default","is","``","None","``",".","Returns","--","--","--","-","tensor","<","[","\\","*","D_out","]",",","T",">","or","tensor","<","[","n",",","len","(","D1",")","]",",","int32",">","*","If","``","a",",","b","``","are","both","provided",",","the","return","shape","is","based","on","broadcast","rules","from","``","cond",",","a",",","b","``",".","*","If","``","a",",","b","``","are","``","None","``",",","the","return","shape","is","2-D",",","where","the","first","dimension","``","n","``","is","the","number","of","matching","indices","in","``","cond","``",",","and","``","len","(","D1",")","``","is","the","rank","of","``","cond","``",".","Attributes","--","--","--","--","--","B",":","bool","T",":","fp16",",","fp32",",","i32",",","bool"]
code: def type_inference(self):
      typea = self.a.sym_type
      typeb = self.b.sym_type
      primitive_type = promoted_primitive_type(typea, typeb)
      if primitive_type is None:
          raise ValueError(
              "Incompatible primitive types in broadcast operation"
          )
  
      return infer_type_with_broadcast(typea, typeb, primitive_type)
  
imports: import copy
  import numpy
  from coremltools import _logger
  from coremltools.converters.mil.mil import Block, get_existing_symbol, get_new_symbol, types
  from coremltools.converters.mil.mil.input_type import DefaultInputs, InputSpec, InternalInputType, ListInputType, PyFunctionInputType, TensorInputType, TupleInputType
  from coremltools.converters.mil.mil.operation import NONE, SYMBOL, VALUE, Operation, mil_list, precondition
  from coremltools.converters.mil.mil.ops.defs._op_reqs import register_op
  from coremltools.converters.mil.mil.ops.defs._utils import infer_type_with_broadcast, promoted_primitive_type
  from coremltools.converters.mil.mil.types import is_compatible_type
  from coremltools.converters.mil.mil.types.type_list import list
  from coremltools.converters.mil.mil.types.type_mapping import builtin_to_string, is_subtype, numpy_type_to_builtin_type, numpy_val_to_builtin_val
label_desc: Use image node_id 1 for calling the select obj's underlying member method code with example usage: obj.type_inference() and returns: infer_type_with_broadcast