Where

genel final dersi Nerede

Bir tensördeki sıfır olmayan/doğru değerlerin konumlarını döndürür.

Bu işlem "koşul"daki gerçek öğelerin koordinatlarını döndürür. Koordinatlar, ilk boyutun (satırlar) gerçek öğelerin sayısını temsil ettiği ve ikinci boyutun (sütunlar) gerçek öğelerin koordinatlarını temsil ettiği 2 boyutlu bir tensörde döndürülür. Çıkış tensörünün şeklinin, 'durum'da kaç tane gerçek değer olduğuna bağlı olarak değişebileceğini unutmayın. Endeksler satır ana sırasına göre çıkarılır.

Örneğin:

# 'input' tensor is [[True, False]
 #                    [True, False]]
 # 'input' has two true values, so output has two coordinates.
 # 'input' has rank of 2, so coordinates have two indices.
 where(input) ==> [[0, 0],
                   [1, 0]]
 
 # `condition` tensor is [[[True, False]
 #                     [True, False]]
 #                    [[False, True]
 #                     [False, True]]
 #                    [[False, False]
 #                     [False, True]]]
 # 'input' has 5 true values, so output has 5 coordinates.
 # 'input' has rank of 3, so coordinates have three indices.
 where(input) ==> [[0, 0, 0],
                   [0, 1, 0],
                   [1, 0, 1],
                   [1, 1, 1],
                   [2, 1, 1]]
 
 # `condition` tensor is [[[1.5,  0.0]
 #                     [-0.5, 0.0]]
 #                    [[0.0,  0.25]
 #                     [0.0,  0.75]]
 #                    [[0.0,  0.0]
 #                     [0.0,  0.01]]]
 # 'input' has 5 nonzero values, so output has 5 coordinates.
 # 'input' has rank of 3, so coordinates have three indices.
 where(input) ==> [[0, 0, 0],
                   [0, 1, 0],
                   [1, 0, 1],
                   [1, 1, 1],
                   [2, 1, 1]]
 
 # `condition` tensor is [[[1.5 + 0.0j, 0.0  + 0.0j]
 #                     [0.0 + 0.5j, 0.0  + 0.0j]]
 #                    [[0.0 + 0.0j, 0.25 + 1.5j]
 #                     [0.0 + 0.0j, 0.75 + 0.0j]]
 #                    [[0.0 + 0.0j, 0.0  + 0.0j]
 #                     [0.0 + 0.0j, 0.01 + 0.0j]]]
 # 'input' has 5 nonzero magnitude values, so output has 5 coordinates.
 # 'input' has rank of 3, so coordinates have three indices.
 where(input) ==> [[0, 0, 0],
                   [0, 1, 0],
                   [1, 0, 1],
                   [1, 1, 1],
                   [2, 1, 1]]
 

Genel Yöntemler

Çıkış <Uzun>
Çıkış olarak ()
Bir tensörün sembolik tutamacını döndürür.
statik <T> Nerede
create ( Kapsam kapsamı, İşlenen <T> koşulu)
Yeni bir Where işlemini saran bir sınıf oluşturmak için fabrika yöntemi.
Çıkış <Uzun>
dizin ()

Kalıtsal Yöntemler

Genel Yöntemler

genel Çıkış <Uzun> asOutput ()

Bir tensörün sembolik tutamacını döndürür.

TensorFlow işlemlerinin girdileri, başka bir TensorFlow işleminin çıktılarıdır. Bu yöntem, girişin hesaplanmasını temsil eden sembolik bir tanıtıcı elde etmek için kullanılır.

public static Where create ( Kapsam kapsamı, İşlenen <T> koşulu)

Yeni bir Where işlemini saran bir sınıf oluşturmak için fabrika yöntemi.

Parametreler
kapsam mevcut kapsam
İadeler
  • Where'in yeni bir örneği

genel Çıkış <Uzun> dizini ()