تدفق التوتر:: العمليات:: جمعV2

#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:: ops:: GatherV2:: Attrs

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

الصفات العامة

عملية

Operation operation

انتاج

::tensorflow::Output output

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

جمعV2

 GatherV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input params,
  ::tensorflow::Input indices,
  ::tensorflow::Input axis
)

جمعV2

 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
)