Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
dòng chảy căng:: ôi:: Ngẫu nhiên
#include <random_ops.h>
Ngẫu nhiên xáo trộn một tensor dọc theo chiều đầu tiên của nó.
Bản tóm tắt
Tenxơ được xáo trộn dọc theo chiều 0, sao cho mỗi value[j]
được ánh xạ tới một và chỉ một output[i]
. Ví dụ: ánh xạ có thể xảy ra đối với tensor 3x2 là:
[[1, 2], [[5, 6],
[3, 4], ==> [1, 2],
[5, 6]] [3, 4]]
Lập luận:
- phạm vi: Một đối tượng Phạm vi
- value: Tenxor được xáo trộn.
Thuộc tính tùy chọn (xem Attrs
):
- hạt giống: Nếu
seed
hoặc seed2
được đặt khác 0, bộ tạo số ngẫu nhiên sẽ được gieo hạt giống đã cho. Nếu không, nó sẽ được gieo bởi một hạt giống ngẫu nhiên. - Seed2: Hạt giống thứ hai để tránh va chạm hạt giống.
Trả về:
-
Output
: Một tensor có cùng hình dạng và loại với value
, được xáo trộn dọc theo chiều đầu tiên của nó.
Các hàm tĩnh công khai |
---|
Seed (int64 x) | |
Seed2 (int64 x) | |
Thuộc tính công khai
Chức năng công cộng
nút
::tensorflow::Node * node() const
operator::tensorflow::Input() const
toán tử::tenorflow::Đầu ra
operator::tensorflow::Output() const
Các hàm tĩnh công khai
Hạt giống
Attrs Seed(
int64 x
)
Hạt giống2
Attrs Seed2(
int64 x
)
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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```"]]