コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
テンソルフロー::作戦::ランダムシャッフル
#include <random_ops.h>
テンソルを最初の次元に沿ってランダムにシャッフルします。
まとめ
テンソルは次元 0 に沿ってシャッフルされ、各value[j]
が 1 つのoutput[i]
にのみマッピングされます。たとえば、3x2 テンソルで発生する可能性のあるマッピングは次のとおりです。
[[1, 2], [[5, 6],
[3, 4], ==> [1, 2],
[5, 6]] [3, 4]]
引数:
- スコープ:スコープオブジェクト
- value: シャッフルされるテンソル。
オプションの属性 ( Attrs
を参照):
- シード:
seed
またはseed2
いずれかが 0 以外に設定されている場合、乱数ジェネレーターには指定されたシードがシードされます。それ以外の場合は、ランダム シードによってシードされます。 - シード2: シードの衝突を避けるための 2 番目のシード。
戻り値:
-
Output
: 最初の次元に沿ってシャッフルされた、 value
と同じ形状と型のテンソル。
パブリック属性
公共機能
ノード
::tensorflow::Node * node() const
operator::tensorflow::Input() const
演算子::tensorflow::出力
operator::tensorflow::Output() const
パブリック静的関数
シード2
Attrs Seed2(
int64 x
)
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-27 UTC。
[null,null,["最終更新日 2025-07-27 UTC。"],[],[],null,["# tensorflow::ops::RandomShuffle Class Reference\n\ntensorflow::ops::RandomShuffle\n==============================\n\n`#include \u003crandom_ops.h\u003e`\n\nRandomly shuffles a tensor along its first dimension.\n\nSummary\n-------\n\nThe tensor is shuffled along dimension 0, such that each `value[j]` is mapped to one and only one `output[i]`. For example, a mapping that might occur for a 3x2 tensor is:\n\n\n```text\n[[1, 2], [[5, 6],\n [3, 4], ==\u003e [1, 2],\n [5, 6]] [3, 4]]\n```\n\n\u003cbr /\u003e\n\nArguments:\n\n- scope: A [Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- value: The tensor to be shuffled.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/random-shuffle/attrs#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs)):\n\n- seed: If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.\n- seed2: A second seed to avoid seed collision.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): A tensor of same shape and type as `value`, shuffled along its first dimension.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [RandomShuffle](#classtensorflow_1_1ops_1_1_random_shuffle_1a85aad10494a449f347a9190a38280283)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` value)` ||\n| [RandomShuffle](#classtensorflow_1_1ops_1_1_random_shuffle_1abc84e7abae1c06e33c057531d633d13d)`(const ::`[tensorflow::Scope](/versions/r2.3/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` value, const `[RandomShuffle::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/random-shuffle/attrs#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_random_shuffle_1ad2db7b1173c07d36b1a6861b104d12a4) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_random_shuffle_1aa615db4848868b8d11a3ca57176b23be) | `::`[tensorflow::Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|--------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_random_shuffle_1a85dbb40592105d985cc361386d997fba)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_random_shuffle_1a8e09a4698ab0eee0183927b971046024)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_random_shuffle_1a3c9d49616ac6d2149f729063a3d8ad4f)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|---------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| [Seed](#classtensorflow_1_1ops_1_1_random_shuffle_1a1ea6f68c5b00c8be84eca3aa1a825a7f)`(int64 x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/random-shuffle/attrs#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs) |\n| [Seed2](#classtensorflow_1_1ops_1_1_random_shuffle_1a7cfb648b8a16f9e12113b7393ec0fde5)`(int64 x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/random-shuffle/attrs#structtensorflow_1_1ops_1_1_random_shuffle_1_1_attrs) |\n\n| ### Structs ||\n|----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::RandomShuffle::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/random-shuffle/attrs) | Optional attribute setters for [RandomShuffle](/versions/r2.3/api_docs/cc/class/tensorflow/ops/random-shuffle#classtensorflow_1_1ops_1_1_random_shuffle). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### RandomShuffle\n\n```gdscript\n RandomShuffle(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input value\n)\n``` \n\n### RandomShuffle\n\n```gdscript\n RandomShuffle(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input value,\n const RandomShuffle::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### Seed\n\n```text\nAttrs Seed(\n int64 x\n)\n``` \n\n### Seed2\n\n```text\nAttrs Seed2(\n int64 x\n)\n```"]]