How to get unique values for a symbol?

Hello, everyone. I am new to mxnet. I’d like to ask whether it is possible to get all unique values for a symbol (withou using asnumpy)?

Thanks a lot.

Not exactly sure what you mean by “all unique values”. Can you clarify the question by adding a few more details or an example showing the input and intended output you’re trying to achieve? You can get the value(s) from a symbol using the python’s __getitem__ syntax i.e s[0] where s is the symbol.

I just find that I can do this with numpy in a custom operator. It is not necessary to do it as symbol. Thanks. What I want to use is numpy.unique()

Hi, can you tell me how you do that? I need a unique operator too. When I follow the this official tutorial to create a unique operator, it requires me to write the function infer_shape, which returns output_shape. But we cannot actually know the output size in advance!