def METHOD_NAME(idx_reduce):
    a_indices = []
    b_indices = []
    for i in range(offset):
        if is_a_larger:
            a_indices.append(idx_spatial[i])
        else:
            b_indices.append(idx_spatial[i])
    for i in range(offset, len(output_shape) - (2 - a_prepended - b_appended)):
        a_dim = a_shape[i if is_a_larger else i - offset]
        b_dim = b_shape[i if not is_a_larger else i - offset]
        dim_equal = a_dim == b_dim
        if not isinstance(dim_equal, tir.IntImm) or dim_equal == 0:
            a_dim_is_one = isinstance(a_dim, tir.IntImm) and a_dim == 1
            b_dim_is_one = isinstance(b_dim, tir.IntImm) and b_dim == 1
            a_indices.append(0 if a_dim_is_one else idx_spatial[i])
            b_indices.append(0 if b_dim_is_one else idx_spatial[i])
        else:
            a_indices.append(idx_spatial[i])
            b_indices.append(idx_spatial[i])
    if not a_prepended:
        a_indices.append(idx_spatial[-2 + b_appended])
    a_indices.append(idx_reduce)
    b_indices.append(idx_reduce)
    if not b_appended:
        b_indices.append(idx_spatial[-1])
    dtype = call.attrs.out_dtype
    if dtype != "":
        return a(*a_indices).astype(dtype) * b(*b_indices).astype(dtype)
    return a(*a_indices) * b(*b_indices)