dòng chảy căng:: ôi:: Phân đoạn chưa được sắp xếpTham gia

#include <string_ops.h>

Kết hợp các phần tử của inputs dựa trên segment_ids .

Bản tóm tắt

Tính toán nối chuỗi dọc theo các đoạn của tensor. Cho segment_ids có thứ hạng Ndata có thứ hạng N+M :

`output[i, k1...kM] = strings.join([data[j1...jN, k1...kM])`

trong đó phép nối trên tất cả [j1...jN] sao cho Seg_ids[j1...jN] = i. Các chuỗi được nối theo thứ tự hàng lớn.

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']

Tranh luận:

  • phạm vi: Một đối tượng Phạm vi
  • đầu vào: Đầu vào được nối.
  • Seg_ids: Một tensor có hình dạng là tiền tố của data.shape. Id phân khúc phủ định không được hỗ trợ.
  • num_segments: Một đại lượng vô hướng.

Thuộc tính tùy chọn (xem Attrs ):

  • dấu phân cách: Dấu phân cách sử dụng khi nối.

Trả về:

Hàm 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

Trình 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

Phân đoạn chưa được sắp xếpTham gia

 UnsortedSegmentJoin(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input inputs,
  ::tensorflow::Input segment_ids,
  ::tensorflow::Input num_segments
)

Phân đoạn chưa được sắp xếpTham gia

 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 

toán tử::tenorflow::Đầu vào

 operator::tensorflow::Input() const 

toán tử::tenorflow::Đầu ra

 operator::tensorflow::Output() const 

Các hàm tĩnh công khai

Dấu phân cách

Attrs Separator(
  StringPiece x
)