def _try_match_and_transform_pattern_channel_last(
        self, expand_op: Operation, block: Block
    ) -> bool:
        """
        identify the pattern: `expand_dim` -> `transpose` -> `conv2d` -> `transpose` -> `squeeze`
        """
        # abort composition if dummy dimension is not added as height
        if expand_op.axes.rank != 1 or expand_op.axes.val[0] not in (-3, 1):
            return False

        # `expand_dims` -> `transpose`
        if not _check_child_op_type(expand_op, "transpose"):
            return False
        transpose1_op = expand_op.outputs[0].child_ops[0]

        # abort composition if permutation is not (0, 3, 1, 2)
        perm1 = transpose1_op.perm.val.copy()
        perm1[np.where(perm1 < 0)] += 4
        if np.any(perm1 != (0, 3, 1, 2)):
            return False

        # `transpose` -> `conv`
        if not _check_child_op_type(transpose1_op, "conv"):
            return False
        conv_op = transpose1_op.outputs[0].child_ops[0]

        # `conv` -> `transpose`
        if not _check_child_op_type(conv_op, "transpose"):
            return False
        transpose2_op = conv_op.outputs[0].child_ops[0]

        # abort composition if permutation is not (0, 2, 3, 1)
        perm2 = transpose2_op.perm.val.copy()
        perm2[np.where(perm2 < 0)] += 4
        if np.any(perm2 != (0, 2, 3, 1)):
            return False

        # `transpose` -> `squeeze`
        if not _check_child_op_type(transpose2_op, "squeeze"):
            return False
        squeeze_op = transpose2_op.outputs[0].child_ops[0]

        # abort composition if not squeezing the dummy height
        if squeeze_op.axes.rank != 1 or squeeze_op.axes.val[0] not in (-3, 1):
            return False

        # everything looks good
        return self._try_apply_transform_channel_last(
            expand_op, transpose1_op, conv_op, transpose2_op, squeeze_op, block
        )

        identify the pattern: `expand_dim` -> `transpose` -> `conv2d` -> `transpose` -> `squeeze`
        
coremltools/converters/mil/mil/passes/defs/optimize_conv.py