message: Add additional tests for Unique[WithCounts]
  The existing tests in this file don't check the exact output,
  which must have values in the order of first appearance.
diff: @@ -160,6 +160,16 @@ class UniqueTest(test.TestCase):
  self.assertEqual(len(x), len(tf_idx))
  self.assertEqual(len(tf_y), len(np.unique(x)))
  + def testOrderedByAppearance(self):
  + x = np.array([3, 5, 3, 4, 1, 4, 9, 8, 6, 3, 5, 7, 8, 8, 4, 6, 4, 2, 5, 6])
  + true_y = np.array([3, 5, 4, 1, 9, 8, 6, 7, 2])
  + true_idx = np.array(
  + [0, 1, 0, 2, 3, 2, 4, 5, 6, 0, 1, 7, 5, 5, 2, 6, 2, 8, 1, 6])
  + y, idx = array_ops.unique(x)
  + tf_y, tf_idx = self.evaluate([y, idx])
  + self.assertAllEqual(tf_y, true_y)
  + self.assertAllEqual(tf_idx, true_idx)
  +
  class UniqueWithCountsTest(test.TestCase):
  @@ -284,6 +294,27 @@ class UniqueWithCountsTest(test.TestCase):
  else:
  self.assertEqual(count, np.sum(x == value))
  + def testEmpty(self):
  + x = np.random.randint(2, size=0)
  + y, idx, count = array_ops.unique_with_counts(x)
  + tf_y, tf_idx, tf_count = self.evaluate([y, idx, count])
  +
  + self.assertEqual(len(x), len(tf_idx))
  + self.assertEqual(len(tf_y), len(np.unique(x)))
  + self.assertEqual(len(tf_count), len(y))
  +
  + def testOrderedByAppearance(self):
  + x = np.array([3, 5, 3, 4, 1, 4, 9, 8, 6, 3, 5, 7, 8, 8, 4, 6, 4, 2, 5, 6])
  + true_y = np.array([3, 5, 4, 1, 9, 8, 6, 7, 2])
  + true_idx = np.array(
  + [0, 1, 0, 2, 3, 2, 4, 5, 6, 0, 1, 7, 5, 5, 2, 6, 2, 8, 1, 6])
  + true_count = np.array([3, 3, 4, 1, 1, 3, 3, 1, 1])
  + y, idx, count = array_ops.unique_with_counts(x)
  + tf_y, tf_idx, tf_count = self.evaluate([y, idx, count])
  + self.assertAllEqual(tf_y, true_y)
  + self.assertAllEqual(tf_idx, true_idx)
  + self.assertAllEqual(tf_count, true_count)
  +
  if __name__ == '__main__':
  test.main()
  