View source: R/dataset_methods.R
dataset_unique | R Documentation |
Use this transformation to produce a dataset that contains one instance of each unique element in the input (See example).
dataset_unique(dataset, name = NULL)
dataset |
A tf.Dataset. |
name |
(Optional.) A name for the tf.data operation. |
A tf.Dataset
This transformation only supports datasets which fit into memory and have elements of either tf.int32, tf.int64 or tf.string type.
## Not run:
c(0, 37, 2, 37, 2, 1) %>% as_tensor("int32") %>%
tensor_slices_dataset() %>%
dataset_unique() %>%
as_array_iterator() %>% iterate() %>% sort()
# [1] 0 1 2 37
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.