[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.data.experimental.rejection_resample\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/data/experimental/ops/resampling.py#L20-L50) |\n\nA transformation that resamples a dataset to achieve a target distribution. (deprecated)\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.data.experimental.rejection_resample`](https://www.tensorflow.org/api_docs/python/tf/data/experimental/rejection_resample)\n\n\u003cbr /\u003e\n\n tf.data.experimental.rejection_resample(\n class_func, target_dist, initial_dist=None, seed=None\n )\n\n| **Deprecated:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use [`tf.data.Dataset.rejection_resample(...)`](../../../tf/data/Dataset#rejection_resample).\n| **Note:** Resampling is performed via rejection sampling; some fraction of the input values will be dropped.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `class_func` | A function mapping an element of the input dataset to a scalar [`tf.int32`](../../../tf#int32) tensor. Values should be in `[0, num_classes)`. |\n| `target_dist` | A floating point type tensor, shaped `[num_classes]`. |\n| `initial_dist` | (Optional.) A floating point type tensor, shaped `[num_classes]`. If not provided, the true class distribution is estimated live in a streaming fashion. |\n| `seed` | (Optional.) Python integer seed for the resampler. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Dataset` transformation function, which can be passed to [`tf.data.Dataset.apply`](../../../tf/data/Dataset#apply). ||\n\n\u003cbr /\u003e"]]