code: def test_unique_op(self, X, return_remapping, gc, dc):
      # impl of unique op does not guarantees return order, sort the input
      # so different impl return same outputs
      X = np.sort(X)
  
      op = core.CreateOperator(
          "Unique",
          ["X"],
          ["U", "remap"] if return_remapping else ["U"],
      )
      self.assertDeviceChecks(
          device_options=dc,
          op=op,
          inputs=[X],
          outputs_to_check=[0, 1] if return_remapping else [0],
      )
      self.assertReferenceChecks(
          device_option=gc,
          op=op,
          inputs=[X],
          reference=partial(
              _unique_ref, return_inverse=return_remapping
          ),
      )
  
file_path: pytorch/caffe2/python/operator_test/unique_ops_test.py
imports: from hypothesis import given, settings
  import hypothesis.strategies
  import numpy
  from functools import partial
  from caffe2.python import core
  import caffe2.python.hypothesis_test_util
  import caffe2.python.serialized_test.serialized_test_util
label_desc: Use image node_id 1 for calling the TestUniqueOps obj's underlying member method code with example usage: obj.test_unique_op(X, return_remapping, gc, dc) without return types