def _choose_conv3d_op(
    stride: int,
    pad: int,
    dilate: int,
    x: AITTensor,
    weight: AITTensor,
    bias: [AITTensor],
    groups: int = 1,
) -> ConverterOutput:
    """
    Helper to choose conv3d vs. depthwise_conv3d op based on existence of bias
    and groups
    """
    has_bias = bias is not None
    if groups is None or groups == 1:
        if has_bias:
            C_in = x.shape()[-1].value()

            if 3 == C_in:
                x = ndhwc3to8()(x)
                weight = ndhwc3to8()(weight)
            elif 8 != C_in:
                raise RuntimeError(
                    f"When having bias, conv3d currently only supports C_in == 3 or C_in == 8, but got C_in: {C_in}"
                )

            return conv3d_bias(stride=stride, pad=pad, dilate=dilate, group=1)(
                x, weight, bias
            )
        else:
            return conv3d(stride=stride, pad=pad, dilate=dilate, group=1)(x, weight)
    elif groups == weight._attrs["shape"][0].value():
        return depthwise_conv3d(
            stride=stride, pad=pad, dilate=dilate, group=groups, bias=has_bias
        )(x, weight, bias)
    else:
        raise RuntimeError(
            f"Currently NOT support groups != channels when groups enabled. Got C_in: {C_in} | groups: {groups} | has bias: {has_bias}"
        )

    Helper to choose conv3d vs. depthwise_conv3d op based on existence of bias
    and groups
    
fx2ait/fx2ait/converters/ait_converters.py