tensorflow:: ops:: 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(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input axis
)

العقدة

::tensorflow::Node * node() const 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const