نشكرك على متابعة Google I / O. عرض جميع الجلسات عند الطلب مشاهدة عند الطلب

تينسورفلو :: العمليات :: جمع

#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]

لاحظ أنه في وحدة المعالجة المركزية ، إذا تم العثور على فهرس خارج النطاق ، يتم إرجاع خطأ. في وحدة معالجة الرسومات ، إذا تم العثور على فهرس خارج النطاق ، يتم تخزين 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 :: العمليات :: GatherV2 :: Attrs

محددات السمات الاختيارية لـ GatherV2 .

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

عملية

Operation operation

انتاج

::tensorflow::Output output

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

جمع

 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
)

العقدة

::tensorflow::Node * node() const 

المشغل :: tensorflow :: الإدخال

 operator::tensorflow::Input() const 

المشغل :: Tensorflow :: Output

 operator::tensorflow::Output() const 

وظائف ثابتة عامة

دفعات

Attrs BatchDims(
  int64 x
)