RightShift

パブリック最終クラスRightShift

Elementwise は、`x` と `y` のビット単位の右シフトを計算します。

符号なし整数型の場合は論理シフトを実行し、符号付き整数型の場合は算術シフトを実行します。

`y` が負の場合、または `x` の幅(ビット単位)以上の場合、結果は実装で定義されます。

例:

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)>
 

定数

OP_NAME TensorFlow コア エンジンによって認識される、この演算の名前

パブリックメソッド

出力<T>
asOutput ()
テンソルのシンボリック ハンドルを返します。
static <T extends TNumber > RightShift <T>
create (スコープscope,オペランド<T>x,オペランド<T>y)
新しい RightShift 操作をラップするクラスを作成するファクトリ メソッド。
出力<T>
z ()

継承されたメソッド

定数

パブリック静的最終文字列OP_NAME

TensorFlow コア エンジンによって認識される、この演算の名前

定数値: "右シフト"

パブリックメソッド

public Output <T> asOutput ()

テンソルのシンボリック ハンドルを返します。

TensorFlow オペレーションへの入力は、別の TensorFlow オペレーションの出力です。このメソッドは、入力の計算を表すシンボリック ハンドルを取得するために使用されます。

public static RightShift <T> create (スコープscope、オペランド<T> x、オペランド<T> y)

新しい RightShift 操作をラップするクラスを作成するファクトリ メソッド。

パラメーター
範囲現在のスコープ
戻り値
  • RightShift の新しいインスタンス

public出力<T> z ()