تينسورفلو :: العمليات :: ExpandDims
#include <array_ops.h>
يُدرج بُعدًا 1 في شكل موتر.
ملخص
بالنظر إلى input
موتر ، تُدرج هذه العملية بُعدًا 1 في axis
مؤشر البعد لشكل input
. يبدأ axis
مؤشر البعد من الصفر ؛ إذا حددت رقمًا سالبًا axis
، فسيتم عده للخلف من النهاية.
هذه العملية مفيدة إذا كنت تريد إضافة بُعد دُفعة إلى عنصر واحد. على سبيل المثال ، إذا كان لديك صورة واحدة للشكل [height, width, channels]
، يمكنك جعلها مجموعة من صورة واحدة مع expand_dims(image, 0)
، مما يجعل الشكل [1, height, width, channels]
.
أمثلة أخرى:
# 't' is a tensor of shape [2] shape(expand_dims(t, 0)) ==> [1, 2] shape(expand_dims(t, 1)) ==> [2, 1] shape(expand_dims(t, -1)) ==> [2, 1]
# 't2' is a tensor of shape [2, 3, 5] shape(expand_dims(t2, 0)) ==> [1, 2, 3, 5] shape(expand_dims(t2, 2)) ==> [2, 3, 1, 5] shape(expand_dims(t2, 3)) ==> [2, 3, 5, 1]
تتطلب هذه العملية ما يلي:
-1-input.dims() <= dim <= input.dims()
ترتبط هذه العملية squeeze()
، والذي يزيل أبعاد الحجم 1.
الحجج:
- النطاق: كائن النطاق
- المحور: 0-D (عددي). يحدد فهرس الأبعاد الذي يتم عنده توسيع شكل
input
. يجب أن يكون في النطاق[-rank(input) - 1, rank(input)]
.
عائدات:
-
Output
: يحتوي على نفس البيانات مثلinput
، ولكن شكله له بعد إضافي بحجم 1 مضاف.
البنائين والمدمرين | |
---|---|
ExpandDims (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input axis) |
السمات العامة | |
---|---|
operation | |
output |
الوظائف العامة | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
السمات العامة
عملية
Operation operation
انتاج
::tensorflow::Output output
الوظائف العامة
ExpandDims
ExpandDims( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input axis )
العقدة
::tensorflow::Node * node() const
المشغل :: tensorflow :: الإدخال
operator::tensorflow::Input() const
المشغل :: Tensorflow :: Output
operator::tensorflow::Output() const
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.