tensorflow:: عملیات:: GatherV2

#include <array_ops.h>

برش‌ها را از params axis بر اساس indices جمع‌آوری کنید .

خلاصه

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

استدلال‌ها:

  • دامنه: یک شیء دامنه
  • پارامترها: تانسوری که مقادیر از آن جمع‌آوری می‌شوند. حداقل باید rank axis + 1 باشد.
  • شاخص‌ها: تانسور شاخص. باید در محدوده [0, params.shape[axis]) باشد.
  • محور: محوری که در params برای جمع‌آوری indices از آن استفاده می‌شود. پیش‌فرض‌ها روی بعد اول است. از اندیس‌های منفی پشتیبانی می‌کند.

بازده:

  • Output : مقادیر params که از اندیس‌های داده شده توسط indices جمع‌آوری شده‌اند، با shape 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)

ویژگی‌های عمومی

operation
output

کارکردهای عمومی

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

توابع استاتیک عمومی

BatchDims (int64 x)

ساختارها

tensorflow:: عملیات:: GatherV2:: جذابیت‌ها

تنظیم‌کننده‌های ویژگی اختیاری برای 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 

توابع استاتیک عمومی

بچ دایمز

Attrs BatchDims(
  int64 x
)