RightShift

classe finale pubblica RightShift

Elementwise calcola lo spostamento a destra bit a bit di "x" e "y".

Esegue uno spostamento logico per i tipi interi senza segno e uno spostamento aritmetico per i tipi interi con segno.

Se "y" è negativo oppure maggiore o uguale alla larghezza di "x" in bit, il risultato è definito dall'implementazione.

Esempio:

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)
 
   right_shift_result = bitwise_ops.right_shift(lhs, rhs)
 
   print(right_shift_result)
 
 # This will print:
 # tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int8)
 # tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int16)
 # tf.Tensor([-1 -5 -1 -1], shape=(4,), dtype=int32)
 # tf.Tensor([-1 -5 -1 -1], 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.right_shift(lhs, rhs)
 # <tf.Tensor: shape=(4,), dtype=int8, numpy=array([ -2,  64, 101,  32], dtype=int8)>
 

Costanti

Corda OP_NAME Il nome di questa operazione, come noto al motore principale di TensorFlow

Metodi pubblici

Uscita <T>
comeuscita ()
Restituisce l'handle simbolico del tensore.
statico <T estende TNumero > RightShift <T>
create ( ambito ambito , operando <T> x, operando <T> y)
Metodo factory per creare una classe che racchiude una nuova operazione RightShift.
Uscita <T>
z ()

Metodi ereditati

Costanti

Stringa finale statica pubblica OP_NAME

Il nome di questa operazione, come noto al motore principale di TensorFlow

Valore costante: "RightShift"

Metodi pubblici

Uscita pubblica <T> asOutput ()

Restituisce l'handle simbolico del tensore.

Gli input per le operazioni TensorFlow sono output di un'altra operazione TensorFlow. Questo metodo viene utilizzato per ottenere un handle simbolico che rappresenta il calcolo dell'input.

public static RightShift <T> create ( ambito ambito , operando <T> x, operando <T> y)

Metodo factory per creare una classe che racchiude una nuova operazione RightShift.

Parametri
scopo ambito attuale
ritorna
  • una nuova istanza di RightShift

Uscita pubblica <T> z ()