def get_dynamic_shape(min_shape, max_shape):
    """
    Determine which dimension should be set to -1 according to min/max shape
    """
    assert len(min_shape) == len(max_shape)
    dynamic_shape = []
    for min_inp, max_inp in zip(min_shape, max_shape):
        # If one dimension is same between min_shape and max_shape
        # we consider it as a static dimension. Or it is treated as
        # dynamic dimension which will be set to -1
        dyn = [i if i == j else -1 for i, j in zip(min_inp, max_inp)]
        dynamic_shape.append(dyn)
    return dynamic_shape