tensorflow:: ops:: GatherV2

#include <array_ops.h>

قم بتجميع الشرائح من axis params وفقًا indices .

ملخص

يجب أن تكون indices عبارة عن موتر عددي صحيح بأي بُعد (عادةً ما يكون صفري الأبعاد أو أحادي الأبعاد). ينتج موترًا ناتجًا بالشكل 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]

لاحظ أنه في وحدة المعالجة المركزية، إذا تم العثور على فهرس خارج النطاق، فسيتم إرجاع خطأ. أما في وحدة معالجة الرسومات، فإذا تم العثور على فهرس خارج النطاق، فسيتم تخزين القيمة 0 في قيمة الإخراج المقابلة.

انظر أيضًا إلى tf.batch_gather و tf.gather_nd .

الحجج:

  • النطاق: كائن النطاق
  • المعاملات: الموتر الذي تُجمع منه القيم. يجب أن يكون على الأقل رتبة axis + 1 .
  • المؤشرات: موتر المؤشر. يجب أن يكون في النطاق [0, params.shape[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)

السمات العامة

operation
output

الوظائف العامة

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

الدوال الثابتة العامة

BatchDims (int64 x)

الهياكل

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 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const 

الدوال الثابتة العامة

أبعاد الدفعة

Attrs BatchDims(
  int64 x
)