Tensorflow :: ops :: UnsortedSegmentJoin
#include <string_ops.h>
Verbindet die Elemente von inputs
basierend auf segment_ids
.
Zusammenfassung
Berechnet die Zeichenfolgenverknüpfung entlang Segmenten eines Tensors. Gegeben sind segment_ids
mit Rang N
und data
mit Rang N+M
:
`output[i, k1...kM] = strings.join([data[j1...jN, k1...kM])`
wobei der Join über alle [j1 ... jN] ist, so dass segment_ids [j1 ... jN] = i. Die Zeichenfolgen werden in der Hauptreihenfolge verbunden.
Beispielsweise:
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']
Argumente:
- scope: Ein Scope- Objekt
- Eingänge: Der Eingang, der verbunden werden soll.
- segment_ids: Ein Tensor, dessen Form ein Präfix von data.shape ist. Negative Segment-IDs werden nicht unterstützt.
- num_segments: Ein Skalar.
Optionale Attribute (siehe Attrs
):
- Trennzeichen: Das beim Verbinden zu verwendende Trennzeichen.
Kehrt zurück:
-
Output
: Der Ausgangstensor.
Konstruktoren und Destruktoren | |
---|---|
UnsortedSegmentJoin (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs, :: tensorflow::Input segment_ids, :: tensorflow::Input num_segments) | |
UnsortedSegmentJoin (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs, :: tensorflow::Input segment_ids, :: tensorflow::Input num_segments, const UnsortedSegmentJoin::Attrs & attrs) |
Öffentliche Attribute | |
---|---|
operation | |
output |
Öffentliche Funktionen | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Öffentliche statische Funktionen | |
---|---|
Separator (StringPiece x) |
Strukturen | |
---|---|
tensorflow :: ops :: UnsortedSegmentJoin :: Attrs | Optionale Attributsetzer für UnsortedSegmentJoin . |
Öffentliche Attribute
Operation
Operation operation
Ausgabe
::tensorflow::Output output
Öffentliche Funktionen
UnsortedSegmentJoin
UnsortedSegmentJoin( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input segment_ids, ::tensorflow::Input num_segments )
UnsortedSegmentJoin
UnsortedSegmentJoin( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input segment_ids, ::tensorflow::Input num_segments, const UnsortedSegmentJoin::Attrs & attrs )
Knoten
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Output
operator::tensorflow::Output() const
Öffentliche statische Funktionen
Separator
Attrs Separator( StringPiece x )