tensorflow::ops::UnsortedSegmentJoin
#include <string_ops.h> Kết hợp các phần tử inputs dựa trên segment_ids .
Bản tóm tắt
Tính toán phép nối chuỗi dọc theo các đoạn của tensor. Cho trước segment_ids với hạng N và data với hạng N+M :
`output[i, k1...kM] = strings.join([data[j1...jN, k1...kM])`
Trong đó phép nối được thực hiện trên tất cả [j1...jN] sao cho segment_ids[j1...jN] = i. Các chuỗi được nối theo thứ tự hàng chính.
Ví dụ:
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']Luận điểm:
- phạm vi: Một đối tượng Phạm vi
- Đầu vào: Các đầu vào cần được kết hợp.
- segment_ids: Một tensor có hình dạng là tiền tố của data.shape. Không hỗ trợ các ID phân đoạn âm.
- num_segments: Một giá trị vô hướng.
Các thuộc tính tùy chọn (xem Attrs ):
- Dấu phân cách: Dấu phân cách được sử dụng khi nối.
Trả về:
-
Output: Tensor đầu ra.
Hàm khởi tạo và hàm hủy | |
|---|---|
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) |
Thuộc tính công khai | |
|---|---|
operation | |
output | |
Chức năng công cộng | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
Các hàm tĩnh công khai | |
|---|---|
Separator (StringPiece x) | |
Cấu trúc | |
|---|---|
| tensorflow::ops::UnsortedSegmentJoin::Attrs | Các thiết lập thuộc tính tùy chọn cho UnsortedSegmentJoin . |
Thuộc tính công khai
hoạt động
Operation operation
đầu ra
::tensorflow::Output output
Chức năng công cộng
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 )
nút
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Các hàm tĩnh công khai
Bộ phận tách
Attrs Separator( StringPiece x )