LeftShift

genel son sınıf LeftShift

Elementwise, "x" ve "y"nin bit düzeyinde sola kaymasını hesaplar.

Eğer 'y' negatifse veya bit cinsinden 'x'in genişliğine eşit veya ondan büyükse sonuç uygulama tanımlanır.

Örnek:

import tensorflow as tf
 from tensorflow.python.ops import bitwise_ops
 import numpy as np
 dtype_list = [tf.int8, tf.int16, tf.int32, tf.int64]
 
 for dtype in dtype_list:
   lhs = tf.constant([-1, -5, -3, -14], dtype=dtype)
   rhs = tf.constant([5, 0, 7, 11], dtype=dtype)
 
   left_shift_result = bitwise_ops.left_shift(lhs, rhs)
 
   print(left_shift_result)
 
 # This will print:
 # tf.Tensor([ -32   -5 -128    0], shape=(4,), dtype=int8)
 # tf.Tensor([   -32     -5   -384 -28672], shape=(4,), dtype=int16)
 # tf.Tensor([   -32     -5   -384 -28672], shape=(4,), dtype=int32)
 # tf.Tensor([   -32     -5   -384 -28672], shape=(4,), dtype=int64)
 
 lhs = np.array([-2, 64, 101, 32], dtype=np.int8)
 rhs = np.array([-1, -5, -3, -14], dtype=np.int8)
 bitwise_ops.left_shift(lhs, rhs)
 # <tf.Tensor: shape=(4,), dtype=int8, numpy=array([ -2,  64, 101,  32], dtype=int8)>
 

Sabitler

Sicim OP_NAME Bu operasyonun TensorFlow çekirdek motoru tarafından bilinen adı

Genel Yöntemler

Çıkış <T>
Çıkış olarak ()
Tensörün sembolik tutamacını döndürür.
statik <T TNumber'ı genişletir > Sola Kaydırma <T>
create ( Kapsam kapsamı, İşlenen <T> x, İşlenen <T> y)
Yeni bir LeftShift işlemini saran bir sınıf oluşturmanın fabrika yöntemi.
Çıkış <T>
z ()

Kalıtsal Yöntemler

Sabitler

genel statik son Dize OP_NAME

Bu operasyonun TensorFlow çekirdek motoru tarafından bilinen adı

Sabit Değer: "Sola Kaydırma"

Genel Yöntemler

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

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 LeftShift <T> create ( Kapsam kapsamı, İşlenen <T> x, İşlenen <T> y)

Yeni bir LeftShift işlemini saran bir sınıf oluşturmanın fabrika yöntemi.

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

genel Çıkış <T> z ()