(builder, node, graph, err)
convert to CoreML Add Broadcastable Layer and Divide BroadCastable Layer:
    https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L4117
convert to CoreML Add Broadcastable Layer and Divide BroadCastable Layer:
    https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L4117
convert to CoreML Add Broadcastable Layer and Divide BroadCastable Layer : https : // github . com / apple / coremltools / blob / 655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492 / mlmodel / format / NeuralNetwork . proto#L4117
def _convert_mean(builder, node, graph, err):
    '''
    convert to CoreML Add Broadcastable Layer and Divide BroadCastable Layer:
    https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L4117
    '''
    number_of_inputs = len(node.inputs)
    output_name = node.outputs[0]
    node.outputs[0] = node.outputs[0] + '_sum'

    builder.add_load_constant_nd(
        name=node.name + '_divider',
        output_name=output_name+'_divider',
        constant_value=np.array(number_of_inputs),
        shape=[1]
    )
    add_broadcastable_op_chain(builder, node, err, builder.add_add_broadcastable)
    builder.add_divide_broadcastable(
        name=node.name+'_mean',
        input_names=[node.outputs[0], output_name+'_divider'],
        output_name=output_name
    )
def _convert_mean ( builder , node , graph , err ) : number_of_inputs = len ( node . inputs ) output_name = node . outputs [ 0 ] node . outputs [ 0 ] = node . outputs [ 0 ] + '_sum' builder . add_load_constant_nd ( name = node . name + '_divider' , output_name = output_name + '_divider' , constant_value = np . array ( number_of_inputs ) , shape = [ 1 ] ) add_broadcastable_op_chain ( builder , node , err , builder . add_add_broadcastable ) builder . add_divide_broadcastable ( name = node . name + '_mean' , input_names = [ node . outputs [ 0 ] , output_name + '_divider' ] , output_name = output_name )