tensorflow::ops::GatherV2
#include <array_ops.h> Thu thập các lát cắt từ axis tham params theo indices .
Bản tóm tắt
indices phải là một tensor số nguyên có bất kỳ chiều nào (thường là 0 chiều hoặc 1 chiều). Tạo ra một tensor đầu ra với hình dạng 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 phạm vi, lỗi sẽ được trả về. Trên GPU, nếu tìm thấy chỉ mục nằm ngoài phạm vi, giá trị 0 sẽ được lưu trữ trong giá trị đầu ra tương ứng.
Xem thêm tf.batch_gather và tf.gather_nd .
Luận điểm:
- phạm vi: Một đối tượng Phạm vi
- params: Tensor dùng để thu thập các giá trị. Phải có hạng ít nhất là
axis + 1. - indices: Tensor chỉ số. Phải nằm trong phạm vi
[0, params.shape[axis]). - axis: Trục trong
paramsđể thu thậpindices. Mặc định là chiều thứ nhất. Hỗ trợ chỉ số âm.
Trả về:
-
Output: Các giá trị từparamsđược thu thập từ các chỉ số được cung cấp bởiindices, với hình dạngparams.shape[:axis] + indices.shape + params.shape[axis + 1:].
Hàm khởi tạo và hàm 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 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 | |
|---|---|
BatchDims (int64 x) | |
Cấu trúc | |
|---|---|
| tensorflow::ops::GatherV2::Attrs | Các thiết lập thuộc tính tùy chọn cho GatherV2 . |
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
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
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Các hàm tĩnh công khai
BatchDims
Attrs BatchDims( int64 x )