tensorflow :: ops :: ExpandDims
#include <array_ops.h>
Bir tensör şekline 1 boyutu ekler.
Özet
Bir tensör input
verildiğinde, bu işlem, input
şeklinin boyut indeksi axis
1 boyutu ekler. Boyut dizini axis
sıfırdan başlar; axis
için negatif bir sayı belirtirseniz, sondan geriye doğru sayılır.
Bu işlem, tek bir öğeye bir toplu iş boyutu eklemek istiyorsanız kullanışlıdır. Örneğin, tek bir şekil [height, width, channels]
expand_dims(image, 0)
bunu [1, height, width, channels]
şeklini oluşturan expand_dims(image, 0)
ile 1 resimden oluşan bir grup yapabilirsiniz. .
Diğer örnekler:
# '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]
Bu işlem şunları gerektirir:
-1-input.dims() <= dim <= input.dims()
Bu işlem, boyut 1'in boyutlarını kaldıran squeeze()
ile ilgilidir.
Argümanlar:
- kapsam: Bir Scope nesnesi
- eksen: 0-D (skaler).
input
şeklinin genişletileceği boyut dizinini belirtir.[-rank(input) - 1, rank(input)]
aralığında olmalıdır.
İadeler:
-
Output
:input
aynı verileri içerir, ancak şekline ek boyut 1 ek boyutu vardır.
Yapıcılar ve Yıkıcılar | |
---|---|
ExpandDims (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input axis) |
Genel özellikler | |
---|---|
operation | |
output |
Kamusal işlevler | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Genel özellikler
operasyon
Operation operation
çıktı
::tensorflow::Output output
Kamusal işlevler
ExpandDims
ExpandDims( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input axis )
düğüm
::tensorflow::Node * node() const
operator :: tensorflow :: Girdi
operator::tensorflow::Input() const
operator :: tensorflow :: Çıktı
operator::tensorflow::Output() const