dòng chảy :: hoạt động :: UnsortedSegmentJoin

#include <string_ops.h>

Tham gia các phần tử của inputs dựa trên segment_ids .

Tóm lược

Tính toán tham gia chuỗi dọc theo các phân đoạn của một tensor. Cho các giá segment_ids có xếp hạng Ndata có xếp hạng N+M :

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

trong đó phép nối nằm trên tất cả [j1 ... jN] sao cho segment_ids [j1 ... jN] = i. Các chuỗi được nối theo thứ tự chính của hàng.

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 kết hợp.
  • segment_ids: Một tensor có hình dạng là tiền tố của data.shape. Id phân đoạn phủ định không được hỗ trợ.
  • num_searies: Một đại lượng vô hướng.

Các thuộc tính tùy chọn (xem Phần Attrs ):

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

Lợi nhuận:

  • Output : Bộ căng đầu ra.

Người xây dựng và Người phá 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 chức năng tĩnh công khai

Separator (StringPiece x)

Cấu trúc

tensorflow :: ops :: UnsortedSegmentJoin :: Attrs

Bộ 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 

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

 operator::tensorflow::Input() const 

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

 operator::tensorflow::Output() const 

Các chức năng tĩnh công khai

Dấu phân cách

Attrs Separator(
  StringPiece x
)