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

#include <array_ops.h>

Thu thập các lát cắt từ params axis tham số theo indices .

Bản tóm tắt

indices phải là một số nguyên có kích thước bất kỳ (thường là 0-D hoặc 1-D). Tạo ra một tensor đầu ra với shape params.shape[:axis] + indices.shape + params.shape[axis + 1:] trong đó:

    # Scalar indices (output is rank(params) - 1).
    output[a_0, ..., a_n, b_0, ..., b_n] =
      params[a_0, ..., a_n, indices, b_0, ..., b_n]

    # Vector indices (output is rank(params)).
    output[a_0, ..., a_n, i, b_0, ..., b_n] =
      params[a_0, ..., a_n, indices[i], b_0, ..., b_n]

    # Higher rank indices (output is rank(params) + rank(indices) - 1).
    output[a_0, ..., a_n, i, ..., j, b_0, ... b_n] =
      params[a_0, ..., a_n, indices[i, ..., j], b_0, ..., b_n]

Lưu ý rằng trên CPU, nếu tìm thấy chỉ mục nằm ngoài giới hạn, lỗi sẽ được trả về. Trên GPU, nếu tìm thấy chỉ mục ngoài giới hạn, thì số 0 được lưu trong giá trị đầu ra tương ứng.

Xem thêm tf.batch_gathertf.gather_nd .

Tranh luận:

  • phạm vi: Một đối tượng Phạm vi
  • params: tensor để thu thập các giá trị. Ít nhất phải là axis + 1 .
  • chỉ số: tensor chỉ số. Phải nằm trong phạm vi [0, params.shape[axis]) .
  • params : Trục trong các tham số để thu thập indices từ đó. Mặc định là thứ nguyên đầu tiên. Hỗ trợ các chỉ số tiêu cực.

Lợi nhuận:

  • Output : Giá trị từ các tham số được tập hợp từ các chỉ số được indices số cho trước, với hình dạng params params.shape[:axis] + indices.shape + params.shape[axis + 1:] .

Người xây dựng và Người phá hủy

GatherV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input params, :: tensorflow::Input indices, :: tensorflow::Input axis)
GatherV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input params, :: tensorflow::Input indices, :: tensorflow::Input axis, const GatherV2::Attrs & attrs)

Thuộc tính công cộng

operation
output

Chức năng công cộng

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

Chức năng tĩnh công khai

BatchDims (int64 x)

Cấu trúc

tensorflow :: ops :: GatherV2 :: Attrs

Bộ thiết lập thuộc tính tùy chọn cho GatherV2 .

Thuộc tính công cộng

hoạt động

Operation operation

đầu ra

::tensorflow::Output output

Chức năng công cộng

GatherV2

 GatherV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input params,
  ::tensorflow::Input indices,
  ::tensorflow::Input axis
)

GatherV2

 GatherV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input params,
  ::tensorflow::Input indices,
  ::tensorflow::Input axis,
  const GatherV2::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 

Chức năng tĩnh công khai

BatchDims

Attrs BatchDims(
  int64 x
)