Handling operators like `np.unique`, `boolean indexing` in relay

It means the output shape of some operator could not be determined before you actually execute the operator.

Boolean indexing is a good example, where the shape of the output depends on the sum of the second argument index.

>>> data = mx.nd.array([[1, 2, 3],[4, 5, 6],[7, 8, 9]])
>>> index = mx.nd.array([0, 1, 1])
>>> out = mx.nd.contrib.boolean_mask(data, index)
>>> out
 [[4. 5. 6.]
  [7. 8. 9.]]

<NDArray 2x3 @cpu(0)>

I am not sure it is doable in relay, we could say it is minor usability improvement, but high-level deep learning frameworks like PyTorch, TensorFlow do support this kind of operators and their shape inference.

+1. @junrushao did you find a way to support this?

I believe @haichen is working on it. Anyway, stay tuned :slight_smile:

@haichen, is there any update? :slight_smile:

@jonso You can check the Any RFC and draft PR that @jroesch and I are working on. This is still an initial step to support dynamic shape.