MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / unique

Function unique

tensorflow/contrib/data/python/ops/unique.py:25–42  ·  view source on GitHub ↗

Creates a `Dataset` from another `Dataset`, discarding duplicates. Use this transformation to produce a dataset that contains one instance of each unique element in the input. For example: ```python dataset = tf.data.Dataset.from_tensor_slices([1, 37, 2, 37, 2, 1]) # Using `unique()` wi

()

Source from the content-addressed store, hash-verified

23
24@deprecation.deprecated(None, "Use `tf.data.experimental.unique()`.")
25def unique():
26 """Creates a `Dataset` from another `Dataset`, discarding duplicates.
27
28 Use this transformation to produce a dataset that contains one instance of
29 each unique element in the input. For example:
30
31 ```python
32 dataset = tf.data.Dataset.from_tensor_slices([1, 37, 2, 37, 2, 1])
33
34 # Using `unique()` will drop the duplicate elements.
35 dataset = dataset.apply(tf.data.experimental.unique()) # ==> { 1, 37, 2 }
36 ```
37
38 Returns:
39 A `Dataset` transformation function, which can be passed to
40 `tf.data.Dataset.apply`.
41 """
42 return experimental_unique.unique()

Callers 15

GenerateBoundariesFunction · 0.50
GetNodesToModifyFunction · 0.50
PhiMethod · 0.50
ComputePositionsMethod · 0.50
SortAndUniquifyValuesMethod · 0.50
ComputeAliasedBuffersMethod · 0.50
ComputeBuffersAtMethod · 0.50
SortAndRemoveDuplicatesFunction · 0.50
CanonicalizeNodeFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected