tf.raw_ops.RandomDatasetV2
Stay organized with collections
Save and categorize content based on your preferences.
Creates a Dataset that returns pseudorandom numbers.
tf.raw_ops.RandomDatasetV2(
seed,
seed2,
seed_generator,
output_types,
output_shapes,
rerandomize_each_iteration=False,
metadata='',
name=None
)
Creates a Dataset that returns a stream of uniformly distributed
pseudorandom 64-bit signed integers. It accepts a boolean attribute that
determines if the random number generators are re-applied at each epoch. The
default value is True which means that the seeds are applied and the same
sequence of random numbers are generated at each epoch. If set to False, the
seeds are not re-applied and a different sequence of random numbers are
generated at each epoch.
In the TensorFlow Python API, you can instantiate this dataset via the
class tf.data.experimental.RandomDatasetV2
.
Args |
seed
|
A Tensor of type int64 .
A scalar seed for the random number generator. If either seed or
seed2 is set to be non-zero, the random number generator is seeded
by the given seed. Otherwise, a random seed is used.
|
seed2
|
A Tensor of type int64 .
A second scalar seed to avoid seed collision.
|
seed_generator
|
A Tensor of type resource .
A resource for the random number seed generator.
|
output_types
|
A list of tf.DTypes that has length >= 1 .
|
output_shapes
|
A list of shapes (each a tf.TensorShape or list of ints ) that has length >= 1 .
|
rerandomize_each_iteration
|
An optional bool . Defaults to False .
A boolean attribute to rerandomize the sequence of random numbers generated
at each epoch.
|
metadata
|
An optional string . Defaults to "" .
|
name
|
A name for the operation (optional).
|
Returns |
A Tensor of type variant .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.raw_ops.RandomDatasetV2\n\n\u003cbr /\u003e\n\nCreates a Dataset that returns pseudorandom numbers.\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.raw_ops.RandomDatasetV2`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/RandomDatasetV2)\n\n\u003cbr /\u003e\n\n tf.raw_ops.RandomDatasetV2(\n seed,\n seed2,\n seed_generator,\n output_types,\n output_shapes,\n rerandomize_each_iteration=False,\n metadata='',\n name=None\n )\n\nCreates a Dataset that returns a stream of uniformly distributed\npseudorandom 64-bit signed integers. It accepts a boolean attribute that\ndetermines if the random number generators are re-applied at each epoch. The\ndefault value is True which means that the seeds are applied and the same\nsequence of random numbers are generated at each epoch. If set to False, the\nseeds are not re-applied and a different sequence of random numbers are\ngenerated at each epoch.\n\nIn the TensorFlow Python API, you can instantiate this dataset via the\nclass `tf.data.experimental.RandomDatasetV2`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `seed` | A `Tensor` of type `int64`. A scalar seed for the random number generator. If either seed or seed2 is set to be non-zero, the random number generator is seeded by the given seed. Otherwise, a random seed is used. |\n| `seed2` | A `Tensor` of type `int64`. A second scalar seed to avoid seed collision. |\n| `seed_generator` | A `Tensor` of type `resource`. A resource for the random number seed generator. |\n| `output_types` | A list of `tf.DTypes` that has length `\u003e= 1`. |\n| `output_shapes` | A list of shapes (each a [`tf.TensorShape`](../../tf/TensorShape) or list of `ints`) that has length `\u003e= 1`. |\n| `rerandomize_each_iteration` | An optional `bool`. Defaults to `False`. A boolean attribute to rerandomize the sequence of random numbers generated at each epoch. |\n| `metadata` | An optional `string`. Defaults to `\"\"`. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Tensor` of type `variant`. ||\n\n\u003cbr /\u003e"]]