جریان تنسور:: عملیات:: GatherV2
#include <array_ops.h>
برش ها را از axis
محور params
بر اساس indices
جمع آوری کنید .
خلاصه
indices
باید یک تانسور صحیح از هر بعد (معمولاً 0-D یا 1-D) باشند. یک تانسور خروجی با شکل params.shape[:axis] + indices.shape + params.shape[axis + 1:]
تولید می کند که در آن:
# 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]

توجه داشته باشید که در CPU، اگر یک نمایه خارج از کران پیدا شود، یک خطا برگردانده می شود. در GPU، اگر یک نمایه خارج از کران پیدا شود، 0 در مقدار خروجی مربوطه ذخیره می شود.
همچنین tf.batch_gather
و tf.gather_nd
را ببینید.
استدلال ها:
- scope: یک شی Scope
- پارامترها: تانسوری که از آن مقادیر جمع آوری می شود. باید حداقل
axis + 1
باشد. - شاخص ها: تانسور شاخص. باید در محدوده
[0, params.shape[axis])
باشد. - axis: محور در
params
برای جمع آوریindices
. پیشفرض در بعد اول است. از شاخص های منفی پشتیبانی می کند.
برمی گرداند:
-
Output
: مقادیرparams
جمعآوری شده از شاخصهای دادهشده توسطindices
، با شکلparams.shape[:axis] + indices.shape + params.shape[axis + 1:]
.
سازندگان و ویرانگرها | |
---|---|
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) |
توابع عمومی | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
سازه ها | |
---|---|
tensorflow:: ops:: GatherV2:: Attrs | تنظیم کننده های ویژگی اختیاری برای GatherV2 . |
صفات عمومی
عملیات
Operation operation
خروجی
::tensorflow::Output output
توابع عمومی
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
)
گره
::tensorflow::Node * node() const
عملگر::tensorflow::ورودی
operator::tensorflow::Input() const
عملگر::tensorflow::خروجی
operator::tensorflow::Output() const
توابع استاتیک عمومی
BatchDims
Attrs BatchDims(
int64 x
)