(builder, node, graph, err)
Supported shapes by CoreML 2.0 for broadcasting (-1 means it can be 1 or greater than 1):
    (i.e. all of the outputs must have one of these shapes for broadcasting support)
    - (S=-1,B=-1,1,1,1)
    - (S=-1,B=-1,C,1,1)
    - (S=-1,B=-1,1,H,W)
    - (S=-1,B=-1,C,H,W)
    Unsupported:
    - (S=-1,B=-1,1,1,W)
    - (S=-1,B=-1,1,H,1)
    - (S=-1,B=-1,C,1,W)
    - (S=-1,B=-1,C,H,1)
Supported shapes by CoreML 2.0 for broadcasting (-1 means it can be 1 or greater than 1):
    (i.e. all of the outputs must have one of these shapes for broadcasting support)
    - (S=-1,B=-1,1,1,1)
    - (S=-1,B=-1,C,1,1)
    - (S=-1,B=-1,1,H,W)
    - (S=-1,B=-1,C,H,W)
    Unsupported:
    - (S=-1,B=-1,1,1,W)
    - (S=-1,B=-1,1,H,1)
    - (S=-1,B=-1,C,1,W)
    - (S=-1,B=-1,C,H,1)
Supported shapes by CoreML 2 . 0 for broadcasting ( - 1 means it can be 1 or greater than 1 ) : ( i . e . all of the outputs must have one of these shapes for broadcasting support ) - ( S = - 1 B = - 1 1 1 1 ) - ( S = - 1 B = - 1 C 1 1 ) - ( S = - 1 B = - 1 1 H W ) - ( S = - 1 B = - 1 C H W ) Unsupported : - ( S = - 1 B = - 1 1 1 W ) - ( S = - 1 B = - 1 1 H 1 ) - ( S = - 1 B = - 1 C 1 W ) - ( S = - 1 B = - 1 C H 1 )
def _convert_add(builder, node, graph, err):  # type: (NeuralNetworkBuilder, Node, Graph, ErrorHandling) -> None

    # check if its equivalent to a bias layer
    if len(node.inputs) > 1:
        if node.inputs[1] in node.input_tensors:
            second_input = np.squeeze(node.input_tensors[node.inputs[1]])
            if len(second_input.shape) == 1:
                builder.add_bias(name=node.name,
                                 b=second_input,
                                 input_name=node.inputs[0],
                                 output_name=node.outputs[0],
                                 shape_bias=[second_input.shape[0]])
                return
    '''
    Supported shapes by CoreML 2.0 for broadcasting (-1 means it can be 1 or greater than 1):
    (i.e. all of the outputs must have one of these shapes for broadcasting support)
    - (S=-1,B=-1,1,1,1)
    - (S=-1,B=-1,C,1,1)
    - (S=-1,B=-1,1,H,W)
    - (S=-1,B=-1,C,H,W)
    Unsupported:
    - (S=-1,B=-1,1,1,W)
    - (S=-1,B=-1,1,H,1)
    - (S=-1,B=-1,C,1,W)
    - (S=-1,B=-1,C,H,1)
    '''
    _convert_broadcast_op(builder, node, graph, err, "ADD")
def _convert_add ( builder , node , graph , err ) : # type: (NeuralNetworkBuilder, Node, Graph, ErrorHandling) -> None # check if its equivalent to a bias layer if len ( node . inputs ) > 1 : if node . inputs [ 1 ] in node . input_tensors : second_input = np . squeeze ( node . input_tensors [ node . inputs [ 1 ] ] ) if len ( second_input . shape ) == 1 : builder . add_bias ( name = node . name , b = second_input , input_name = node . inputs [ 0 ] , output_name = node . outputs [ 0 ] , shape_bias = [ second_input . shape [ 0 ] ] ) return _convert_broadcast_op ( builder , node , graph , err , "ADD" )