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:: GiảmTham gia
#include <string_ops.h>
Nối một chuỗi Tensor theo các kích thước nhất định.
Bản tóm tắt
Tính toán nối chuỗi theo các kích thước trong chuỗi đã cho Tensor có hình dạng [\\(d_0, d_1, ..., d_{n-1}\\)]
. Trả về một Tensor mới được tạo bằng cách nối các chuỗi đầu vào với dấu phân cách đã cho (mặc định: chuỗi trống). Các chỉ số âm được tính ngược từ cuối, với -1
tương đương với n - 1
. Nếu các chỉ số không được chỉ định, hãy tham gia trên tất cả các thứ nguyên bắt đầu từ n - 1
đến 0
.
Ví dụ:
# tensor `a` is [["a", "b"], ["c", "d"]]
tf.reduce_join(a, 0) ==> ["ac", "bd"]
tf.reduce_join(a, 1) ==> ["ab", "cd"]
tf.reduce_join(a, -2) = tf.reduce_join(a, 0) ==> ["ac", "bd"]
tf.reduce_join(a, -1) = tf.reduce_join(a, 1) ==> ["ab", "cd"]
tf.reduce_join(a, 0, keep_dims=True) ==> [["ac", "bd"]]
tf.reduce_join(a, 1, keep_dims=True) ==> [["ab"], ["cd"]]
tf.reduce_join(a, 0, separator=".") ==> ["a.c", "b.d"]
tf.reduce_join(a, [0, 1]) ==> "acbd"
tf.reduce_join(a, [1, 0]) ==> "abcd"
tf.reduce_join(a, []) ==> [["a", "b"], ["c", "d"]]
tf.reduce_join(a) = tf.reduce_join(a, [1, 0]) ==> "abcd"
Lập luận:
- phạm vi: Một đối tượng Phạm vi
- đầu vào: Đầu vào được nối. Tất cả các chỉ số rút gọn phải có kích thước khác 0.
- Giảm_indices: Kích thước cần giảm. Kích thước được giảm theo thứ tự được chỉ định. Bỏ qua
reduction_indices
tương đương với việc chuyển [n-1, n-2, ..., 0]
. Các chỉ số âm từ -n
đến -1
được hỗ trợ.
Thuộc tính tùy chọn (xem Attrs
):
- keep_dims: Nếu
True
, giữ lại kích thước đã giảm với độ dài 1
. - dấu phân cách: Dấu phân cách sử dụng khi nối.
Trả về:
-
Output
: Có hình dạng bằng hình dạng của đầu vào với kích thước giảm được loại bỏ hoặc đặt thành 1
tùy thuộc vào keep_dims
.
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
Giữ Dims
Attrs KeepDims(
bool x
)
Dấu phân cách
Attrs Separator(
StringPiece 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-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],null,["# tensorflow::ops::ReduceJoin Class Reference\n\ntensorflow::ops::ReduceJoin\n===========================\n\n`#include \u003cstring_ops.h\u003e`\n\nJoins a string [Tensor](/versions/r2.1/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) across the given dimensions.\n\nSummary\n-------\n\nComputes the string join across dimensions in the given string [Tensor](/versions/r2.1/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) of shape `[\\\\(d_0, d_1, ..., d_{n-1}\\\\)]`. Returns a new [Tensor](/versions/r2.1/api_docs/cc/class/tensorflow/tensor#classtensorflow_1_1_tensor) created by joining the input strings with the given separator (default: empty string). Negative indices are counted backwards from the end, with `-1` being equivalent to `n - 1`. If indices are not specified, joins across all dimensions beginning from `n - 1` through `0`.\n\nFor example:\n\n\n```mysql\n# tensor `a` is [[\"a\", \"b\"], [\"c\", \"d\"]]\ntf.reduce_join(a, 0) ==\u003e [\"ac\", \"bd\"]\ntf.reduce_join(a, 1) ==\u003e [\"ab\", \"cd\"]\ntf.reduce_join(a, -2) = tf.reduce_join(a, 0) ==\u003e [\"ac\", \"bd\"]\ntf.reduce_join(a, -1) = tf.reduce_join(a, 1) ==\u003e [\"ab\", \"cd\"]\ntf.reduce_join(a, 0, keep_dims=True) ==\u003e [[\"ac\", \"bd\"]]\ntf.reduce_join(a, 1, keep_dims=True) ==\u003e [[\"ab\"], [\"cd\"]]\ntf.reduce_join(a, 0, separator=\".\") ==\u003e [\"a.c\", \"b.d\"]\ntf.reduce_join(a, [0, 1]) ==\u003e \"acbd\"\ntf.reduce_join(a, [1, 0]) ==\u003e \"abcd\"\ntf.reduce_join(a, []) ==\u003e [[\"a\", \"b\"], [\"c\", \"d\"]]\ntf.reduce_join(a) = tf.reduce_join(a, [1, 0]) ==\u003e \"abcd\"\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- inputs: The input to be joined. [All](/versions/r2.1/api_docs/cc/class/tensorflow/ops/all#classtensorflow_1_1ops_1_1_all) reduced indices must have non-zero size.\n- reduction_indices: The dimensions to reduce over. Dimensions are reduced in the order specified. Omitting `reduction_indices` is equivalent to passing `[n-1, n-2, ..., 0]`. Negative indices from `-n` to `-1` are supported.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/reduce-join/attrs#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs)):\n\n- keep_dims: If `True`, retain reduced dimensions with length `1`.\n- separator: The separator to use when joining.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.1/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): Has shape equal to that of the input with reduced dimensions removed or set to `1` depending on `keep_dims`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [ReduceJoin](#classtensorflow_1_1ops_1_1_reduce_join_1a5a26b37735fa42ff7193a838ad779913)`(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)` inputs, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` reduction_indices)` ||\n| [ReduceJoin](#classtensorflow_1_1ops_1_1_reduce_join_1a16f60dfc9dd223f31647f7d6b2b8b2aa)`(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)` inputs, ::`[tensorflow::Input](/versions/r2.1/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` reduction_indices, const `[ReduceJoin::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/reduce-join/attrs#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_reduce_join_1ae3c932b8ed453d9ad3c543af34f90263) | [Operation](/versions/r2.1/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_reduce_join_1aae2b38746b0a6787c6bda531650a94df) | `::`[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_reduce_join_1a82dc1971263a0bc85f85e9f9cba8ab5f)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_reduce_join_1a205e8612d71b9bf0327d0983fceacbd7)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_reduce_join_1ad25cf42911f8ba258fbaf2e6ccddb063)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [KeepDims](#classtensorflow_1_1ops_1_1_reduce_join_1a308bbdd23abc9c952087a7842b3c3c62)`(bool x)` | [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/reduce-join/attrs#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs) |\n| [Separator](#classtensorflow_1_1ops_1_1_reduce_join_1aa888289eecaa69b2883039ade1ad7598)`(StringPiece x)` | [Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/reduce-join/attrs#structtensorflow_1_1ops_1_1_reduce_join_1_1_attrs) |\n\n| ### Structs ||\n|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::ReduceJoin::Attrs](/versions/r2.1/api_docs/cc/struct/tensorflow/ops/reduce-join/attrs) | Optional attribute setters for [ReduceJoin](/versions/r2.1/api_docs/cc/class/tensorflow/ops/reduce-join#classtensorflow_1_1ops_1_1_reduce_join). |\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### ReduceJoin\n\n```gdscript\n ReduceJoin(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input inputs,\n ::tensorflow::Input reduction_indices\n)\n``` \n\n### ReduceJoin\n\n```gdscript\n ReduceJoin(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input inputs,\n ::tensorflow::Input reduction_indices,\n const ReduceJoin::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### KeepDims\n\n```text\nAttrs KeepDims(\n bool x\n)\n``` \n\n### Separator\n\n```text\nAttrs Separator(\n StringPiece x\n)\n```"]]