coremltools/converters/onnx/_transformers.py [364:387]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.num_added = 0

    def is_eligible(self, graph, nodes):  # type: (Graph, Sequence[Node]) -> bool
        if not (
            nodes[0].op_type == "Reshape"
            and nodes[1].op_type == "Transpose"
            and nodes[2].op_type == "Reshape"
        ):
            return False
        if len(nodes[0].inputs) == 1 or len(nodes[2].inputs) == 1:
            return False  # it's an old version of onnx Reshape op that had shape as an attribute
        if nodes[0].inputs[1] not in nodes[0].input_tensors:
            return False
        if nodes[2].inputs[1] not in nodes[2].input_tensors:
            return False

        shape_1 = nodes[0].input_tensors[nodes[0].inputs[1]]
        shape_final = nodes[2].input_tensors[nodes[2].inputs[1]]

        shape_1 = _get_fully_defined_shape(shape_1, nodes[0].outputs[0], graph)
        shape_final = _get_fully_defined_shape(shape_final, nodes[2].outputs[0], graph)

        if len(shape_1) != 6 or shape_1[0] != 1 or len(shape_final) != 4:
            return False
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



coremltools/converters/onnx/_transformers.py [457:480]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.num_added = 0

    def is_eligible(self, graph, nodes):  # type: (Graph, Sequence[Node]) -> bool
        if not (
            nodes[0].op_type == "Reshape"
            and nodes[1].op_type == "Transpose"
            and nodes[2].op_type == "Reshape"
        ):
            return False
        if len(nodes[0].inputs) == 1 or len(nodes[2].inputs) == 1:
            return False  # it's an old version of onnx Reshape op that had shape as an attribute
        if nodes[0].inputs[1] not in nodes[0].input_tensors:
            return False
        if nodes[2].inputs[1] not in nodes[2].input_tensors:
            return False

        shape_1 = nodes[0].input_tensors[nodes[0].inputs[1]]
        shape_final = nodes[2].input_tensors[nodes[2].inputs[1]]

        shape_1 = _get_fully_defined_shape(shape_1, nodes[0].outputs[0], graph)
        shape_final = _get_fully_defined_shape(shape_final, nodes[2].outputs[0], graph)

        if len(shape_1) != 6 or shape_1[0] != 1 or len(shape_final) != 4:
            return False
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



