Add python wrapper for unique_with_counts
authorYong Tang <yong.tang.github@outlook.com>
Sat, 27 Jan 2018 19:57:38 +0000 (19:57 +0000)
committerYong Tang <yong.tang.github@outlook.com>
Sat, 24 Feb 2018 03:20:45 +0000 (03:20 +0000)
to call gen_array_ops._unique_with_counts

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
tensorflow/python/ops/array_ops.py

index 08db8a1..1482496 100644 (file)
@@ -1319,6 +1319,18 @@ def unique(x, out_idx=dtypes.int32, name=None):
 unique.__doc__ = gen_array_ops._unique.__doc__
 
 
+@tf_export("unique_with_counts")
+def unique_with_counts(x, out_idx=dtypes.int32, name=None):
+  # TODO(yongtang): switch to v2 once API deprecation
+  # period (3 weeks) pass.
+  # TODO(yongtang): The documentation should also
+  # be updated when switch  to v2.
+  return gen_array_ops._unique_with_counts(x, out_idx, name)
+
+
+unique_with_counts.__doc__ = gen_array_ops._unique_with_counts.__doc__
+
+
 @tf_export("split")
 def split(value, num_or_size_splits, axis=0, num=None, name="split"):
   """Splits a tensor into sub tensors.