tensorflow::ops::ExpandDims
#include <array_ops.h>Bir tensörün şekline 1 boyut ekler.
Özet
Verilen bir tensör input için, bu işlem, input şeklinin boyut indeksi axis 1 boyutunu ekler. Boyut indeksi 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 toplu boyut eklemek istediğinizde kullanışlıdır. Örneğin, [height, width, channels] şeklinde tek bir resminiz varsa, expand_dims(image, 0) ile onu 1 resimden oluşan bir toplu hale getirebilirsiniz; bu da [1, height, width, channels] şeklini oluşturacaktır.
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 için şunlar gereklidir:
-1-input.dims() <= dim <= input.dims()
Bu işlem, boyutu 1 olan boyutları kaldıran squeeze() işleviyle ilgilidir.
Argümanlar:
- kapsam: Bir Kapsam nesnesi
- eksen: 0-Bölge (skaler).
inputşeklini genişletmek için kullanılacak boyut indeksini belirtir.[-rank(input) - 1, rank(input)]aralığında olmalıdır.
İadeler:
-
Output:inputaynı verileri içerir, ancak şekline 1 boyutlu ek bir boyut daha eklenmiştir.
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
Genişlet Boyutlar
ExpandDims( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input axis )
düğüm
::tensorflow::Node * node() const
operatör::tensorflow::Giriş
operator::tensorflow::Input() const
operatör::tensorflow::Çıktı
operator::tensorflow::Output() const