Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::UnsortedSegmentJoin
#include <string_ops.h>
Joins the elements of inputs
based on segment_ids
.
Summary
Computes the string join along segments of a tensor. Given segment_ids
with rank N
and data
with rank N+M
:
`output[i, k1...kM] = strings.join([data[j1...jN, k1...kM])`
where the join is over all [j1...jN] such that segment_ids[j1...jN] = i. Strings are joined in row-major order.
For example:
inputs = [['Y', 'q', 'c'], ['Y', '6', '6'], ['p', 'G', 'a']]
output_array = string_ops.unsorted_segment_join(inputs=inputs,
segment_ids=[1, 0, 1],
num_segments=2,
separator=':'))
# output_array ==> [['Y', '6', '6'], ['Y:p', 'q:G', 'c:a']]
inputs = ['this', 'is', 'a', 'test']
output_array = string_ops.unsorted_segment_join(inputs=inputs,
segment_ids=[0, 0, 0, 0],
num_segments=1,
separator=':'))
# output_array ==> ['this:is:a:test']
Arguments:
- scope: A Scope object
- inputs: The input to be joined.
- segment_ids: A tensor whose shape is a prefix of data.shape. Negative segment ids are not supported.
- num_segments: A scalar.
Optional attributes (see Attrs
):
- separator: The separator to use when joining.
Returns:
Public static functions
|
Separator(StringPiece x)
|
|
Public attributes
Public functions
node
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Public static functions
Separator
Attrs Separator(
StringPiece x
)
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.
Last updated 2020-06-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-06-29 UTC."],[],[],null,["# tensorflow::ops::UnsortedSegmentJoin Class Reference\n\ntensorflow::ops::UnsortedSegmentJoin\n====================================\n\n`#include \u003cstring_ops.h\u003e`\n\nJoins the elements of `inputs` based on `segment_ids`.\n\nSummary\n-------\n\nComputes the string join along segments of a tensor. Given `segment_ids` with rank `N` and `data` with rank `N+M`: \n\n```text\n`output[i, k1...kM] = strings.join([data[j1...jN, k1...kM])`\n```\n\n\u003cbr /\u003e\n\nwhere the join is over all \\[j1...jN\\] such that segment_ids\\[j1...jN\\] = i. Strings are joined in row-major order.\n\nFor example:\n\n\n```scdoc\ninputs = [['Y', 'q', 'c'], ['Y', '6', '6'], ['p', 'G', 'a']]\noutput_array = string_ops.unsorted_segment_join(inputs=inputs,\n segment_ids=[1, 0, 1],\n num_segments=2,\n separator=':'))\n# output_array ==\u003e [['Y', '6', '6'], ['Y:p', 'q:G', 'c:a']]\n```\n\n\u003cbr /\u003e\n\n\n```scdoc\ninputs = ['this', 'is', 'a', 'test']\noutput_array = string_ops.unsorted_segment_join(inputs=inputs,\n segment_ids=[0, 0, 0, 0],\n num_segments=1,\n separator=':'))\n# output_array ==\u003e ['this:is:a:test']\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- inputs: The input to be joined.\n- segment_ids: A tensor whose shape is a prefix of data.shape. Negative segment ids are not supported.\n- num_segments: A scalar.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/unsorted-segment-join/attrs#structtensorflow_1_1ops_1_1_unsorted_segment_join_1_1_attrs)):\n\n- separator: The separator to use when joining.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.3/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): The output tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [UnsortedSegmentJoin](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1adf447c61ece272dac8d94f7eff7f3f9e)`(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)` inputs, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` segment_ids, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` num_segments)` ||\n| [UnsortedSegmentJoin](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1ab5ed8a524316ccca59dc46002c597b27)`(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)` inputs, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` segment_ids, ::`[tensorflow::Input](/versions/r2.3/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` num_segments, const `[UnsortedSegmentJoin::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/unsorted-segment-join/attrs#structtensorflow_1_1ops_1_1_unsorted_segment_join_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|---------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1a230139fb5802e8fcf8e15887dbe2b992) | [Operation](/versions/r2.3/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1ab9ac7ec5286de7b5b7171611e04877e0) | `::`[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_unsorted_segment_join_1a753d6c70509d798ef017819a7c79e85e)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1a9052ff6b4f535fde53718a0f8a3bc9ae)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1af9befc42af0b571e7d88c8bdba3869c8)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|--------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Separator](#classtensorflow_1_1ops_1_1_unsorted_segment_join_1aea0ab0deec12be23090b276aa084b0d0)`(StringPiece x)` | [Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/unsorted-segment-join/attrs#structtensorflow_1_1ops_1_1_unsorted_segment_join_1_1_attrs) |\n\n| ### Structs ||\n|-----------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::UnsortedSegmentJoin::Attrs](/versions/r2.3/api_docs/cc/struct/tensorflow/ops/unsorted-segment-join/attrs) | Optional attribute setters for [UnsortedSegmentJoin](/versions/r2.3/api_docs/cc/class/tensorflow/ops/unsorted-segment-join#classtensorflow_1_1ops_1_1_unsorted_segment_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### UnsortedSegmentJoin\n\n```gdscript\n UnsortedSegmentJoin(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input inputs,\n ::tensorflow::Input segment_ids,\n ::tensorflow::Input num_segments\n)\n``` \n\n### UnsortedSegmentJoin\n\n```gdscript\n UnsortedSegmentJoin(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input inputs,\n ::tensorflow::Input segment_ids,\n ::tensorflow::Input num_segments,\n const UnsortedSegmentJoin::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### Separator\n\n```text\nAttrs Separator(\n StringPiece x\n)\n```"]]