(builder, node, graph, err)
convert to CoreML TopK Layer:
    https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L5190
convert to CoreML TopK Layer:
    https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L5190
convert to CoreML TopK Layer : https : // github . com / apple / coremltools / blob / 655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492 / mlmodel / format / NeuralNetwork . proto#L5190
def _convert_topk(builder, node, graph, err):
    '''
    convert to CoreML TopK Layer:
    https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L5190
    '''
    load_input_constants(builder, node, graph, err)
    axis = node.attrs.get("axis", -1)
    bottom_k = node.attrs.get("largest", True) == False
    # NOTE: Sorted order attribute is currently ignored in CoreML
    sorted_order = node.attrs.get("sorted", True)
    if "sorted" in node.attrs:
        err.unsupported_feature_warning(node, "Sorted Order attribute('sorted') is currently ignored in CoreML 3.0")
    
    builder.add_topk(
        name=node.name,
        input_names=node.inputs,
        output_names=node.outputs,
        axis=axis,
        use_bottom_k=bottom_k
    )
def _convert_topk ( builder , node , graph , err ) : load_input_constants ( builder , node , graph , err ) axis = node . attrs . get ( "axis" , - 1 ) bottom_k = node . attrs . get ( "largest" , True ) == False # NOTE: Sorted order attribute is currently ignored in CoreML sorted_order = node . attrs . get ( "sorted" , True ) if "sorted" in node . attrs : err . unsupported_feature_warning ( node , "Sorted Order attribute('sorted') is currently ignored in CoreML 3.0" ) builder . add_topk ( name = node . name , input_names = node . inputs , output_names = node . outputs , axis = axis , use_bottom_k = bottom_k )