تينسورفلو :: العمليات :: ResourceScatterNdSub
#include <state_ops.h>
يطبق طرحًا متفرقًا على القيم الفردية أو الشرائح في متغير .
ملخص
ref
هو Tensor
رتبة P
indices
هي Tensor
من رتبة Q
يجب أن تكون indices
موتر عدد صحيح ، وتحتوي على مؤشرات في ref
. يجب أن يكون الشكل [d_0, ..., d_{Q-2}, K]
حيث 0 < K <= P
يتوافق البعد الأعمق indices
(بطول K
) مع المؤشرات في عناصر (إذا كان K = P
) أو شرائح (إذا K < P
) على طول البعد K
من ref
.
updates
هي Tensor
من رتبة Q-1+PK
مع الشكل:
[d_0, ..., d_{Q-2}, ref.shape[K], ..., ref.shape[P-1]]
على سبيل المثال ، لنفترض أننا نريد طرح 4 عناصر مبعثرة من موتر من الرتبة 1 يحتوي على 8 عناصر. في بايثون ، سيبدو هذا الطرح كما يلي:
ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8], use_resource=True) indices = tf.constant([[4], [3], [1], [7]]) updates = tf.constant([9, 10, 11, 12]) sub = tf.scatter_nd_sub(ref, indices, updates) with tf.Session() as sess: print sess.run(sub)
سيبدو التحديث الناتج للمرجع كما يلي:
[1, -9, 3, -6, -4, 6, 7, -4]
راجع tf.scatter_nd
للحصول على مزيد من التفاصيل حول كيفية إجراء تحديثات للشرائح.
الحجج:
- النطاق: كائن النطاق
- المرجع: مقبض مورد. يجب أن يكون من VarHandleOp.
- المؤشرات: موتر . يجب أن يكون أحد الأنواع التالية: int32 ، int64. موتر من المؤشرات إلى المرجع.
- تحديثات: A Tensor . يجب أن يكون من نفس نوع المرجع. موتر من القيم لإضافتها إلى المرجع.
السمات الاختيارية (انظر Attrs
):
- use_locking: منطقي اختياري. افتراضات إلى True. إذا كان هذا صحيحًا ، فسيتم حماية التخصيص بقفل ؛ وبخلاف ذلك ، يكون السلوك غير محدد ، ولكنه قد يعرض خلافًا أقل.
عائدات:
-
Operation
تم إنشاؤها
البنائين والمدمرين | |
---|---|
ResourceScatterNdSub (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates) | |
ResourceScatterNdSub (const :: tensorflow::Scope & scope, :: tensorflow::Input ref, :: tensorflow::Input indices, :: tensorflow::Input updates, const ResourceScatterNdSub::Attrs & attrs) |
السمات العامة | |
---|---|
operation |
الوظائف العامة | |
---|---|
operator::tensorflow::Operation () const |
وظائف ثابتة عامة | |
---|---|
UseLocking (bool x) |
الهياكل | |
---|---|
tensorflow :: ops :: ResourceScatterNdSub :: Attrs | محددات السمات الاختيارية لـ ResourceScatterNdSub . |
السمات العامة
عملية
Operation operation
الوظائف العامة
ResourceScatterNdSub
0027383 هـ20ResourceScatterNdSub
ResourceScatterNdSub( const ::tensorflow::Scope & scope, ::tensorflow::Input ref, ::tensorflow::Input indices, ::tensorflow::Input updates, const ResourceScatterNdSub::Attrs & attrs )
المشغل :: Tensorflow :: العملية
operator::tensorflow::Operation() const
وظائف ثابتة عامة
UseLocking
Attrs UseLocking( bool x )
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-04-20 UTC.