6579941f769413ed00f5330ad45c3c5f44c52927,coremltools/converters/nnssa/coreml/graph_pass/op_fusions.py,,_is_NHWC,#Any#Any#,29

Before Change


        return all(graph[inp].attr.get("data_format") == "NHWC" for inp in
            node.inputs[:-1])
    if node in ELEMENTWISE_OPS:
        return all(graph[inp].attr.get("data_format") == "NHWC" for inp in
            node.inputs)
    return False

After Change


            [graph[inp].attr.get("data_format", None) == "NHWC_format_inserted" for inp in node.inputs])

        if NHWC_parent:
            for inp in node.inputs:
                parent_node = graph[inp]
                if parent_node.attr.get("data_format", None) == "NHWC_format_inserted":
                    continue
                elif parent_node.value is not None:
                    // check that the input is a constant and a vector (rank 1)
                    val = np.array(parent_node.value.val)
                    if len(val.shape) == 1 and builtins.is_tensor(parent_node.datatype) and len(parent_node.outputs) == 1:
                        continue
                    else:
                        return False
                else:
                    return False
            return True

    return False
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: apple/coremltools
Commit Name: 6579941f769413ed00f5330ad45c3c5f44c52927
Time: 2019-09-16
Author: awadhwa@apple.com
File Name: coremltools/converters/nnssa/coreml/graph_pass/op_fusions.py
Class Name:
Method Name: _is_NHWC


Project Name: streamlit/streamlit
Commit Name: d24989cdda816343f74a97fc32ce3fd1a689a265
Time: 2019-07-16
Author: thiago@streamlit.io
File Name: lib/streamlit/Server.py
Class Name:
Method Name: _is_url_from_allowed_origins


Project Name: deepfakes/faceswap
Commit Name: fe664e274814a75b56c2f8aeabcb1a51d8f5d4f0
Time: 2020-10-09
Author: 36920800+torzdf@users.noreply.github.com
File Name: scripts/train.py
Class Name: Train
Method Name: _set_timelapse