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:: Đảo ngược hoán vị
#include <array_ops.h>
Tính hoán vị nghịch đảo của tensor.
Bản tóm tắt
Hoạt động này tính toán nghịch đảo của hoán vị chỉ số. Nó lấy một tensor số nguyên 1-D x
, đại diện cho các chỉ số của một mảng dựa trên 0 và hoán đổi từng giá trị với vị trí chỉ mục của nó. Nói cách khác, đối với một tensor đầu ra y
và một tensor đầu vào x
, thao tác này sẽ tính như sau:
y[x[i]] = i for i in [0, 1, ..., len(x) - 1]
Các giá trị phải bao gồm 0. Không được có giá trị trùng lặp hoặc giá trị âm.
Ví dụ:
# tensor `x` is [3, 4, 0, 2, 1]
invert_permutation(x) ==> [2, 4, 3, 0, 1]
Lập luận:
- phạm vi: Một đối tượng phạm vi
- x: 1-D.
Trả về:
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
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-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],null,["# tensorflow::ops::InvertPermutation Class Reference\n\ntensorflow::ops::InvertPermutation\n==================================\n\n`#include \u003carray_ops.h\u003e`\n\nComputes the inverse permutation of a tensor.\n\nSummary\n-------\n\nThis operation computes the inverse of an index permutation. It takes a 1-D integer tensor `x`, which represents the indices of a zero-based array, and swaps each value with its index position. In other words, for an output tensor `y` and an input tensor `x`, this operation computes the following:\n\n\n`y[x[i]] = i for i in [0, 1, ..., len(x) - 1]`\n\nThe values must include 0. There can be no duplicate values or negative values.\n\nFor example:\n\n\n```mysql\n# tensor `x` is [3, 4, 0, 2, 1]\ninvert_permutation(x) ==\u003e [2, 4, 3, 0, 1]\n```\n\n\u003cbr /\u003e\n\nArguments:\n\n- scope: A [Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- x: 1-D.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): 1-D.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [InvertPermutation](#classtensorflow_1_1ops_1_1_invert_permutation_1a47c39ba350709259ed5fbaec9e0e3ef8)`(const ::`[tensorflow::Scope](/versions/r2.1/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` x)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_invert_permutation_1a10bdbd547af396286b226a61b4417c89) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [y](#classtensorflow_1_1ops_1_1_invert_permutation_1a4c610e367ae065a0aa870a4d171fd0d6) | `::`[tensorflow::Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_invert_permutation_1af81a3c965d5a4111a80a32b928075993)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_invert_permutation_1a37078d47cc8bf77238aeb89a0768413b)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_invert_permutation_1a7b457c171ec14a65cc07f10866ddcd76)`() const ` | ` ` ` ` |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### y\n\n```text\n::tensorflow::Output y\n``` \n\nPublic functions\n----------------\n\n### InvertPermutation\n\n```gdscript\n InvertPermutation(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input x\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```"]]