LeftShift

공개 최종 수업 LeftShift

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

상수

OP_NAME TensorFlow 코어 엔진에서 알려진 이 작업의 이름

공개 방법

출력 <T>
출력 ()
텐서의 기호 핸들을 반환합니다.
static <T는 TNumber를 확장합니다. > LeftShift <T>
생성 ( 범위 범위, 피연산자 <T> x, 피연산자 <T> y)
새로운 LeftShift 작업을 래핑하는 클래스를 생성하는 팩토리 메서드입니다.
출력 <T>
z ()

상속된 메서드

상수

공개 정적 최종 문자열 OP_NAME

TensorFlow 코어 엔진에서 알려진 이 작업의 이름

상수 값: "LeftShift"

공개 방법

공개 출력 <T> asOutput ()

텐서의 기호 핸들을 반환합니다.

TensorFlow 작업에 대한 입력은 다른 TensorFlow 작업의 출력입니다. 이 메서드는 입력 계산을 나타내는 기호 핸들을 얻는 데 사용됩니다.

공개 정적 LeftShift <T> 생성 ( 범위 범위, 피연산자 <T> x, 피연산자 <T> y)

새로운 LeftShift 작업을 래핑하는 클래스를 생성하는 팩토리 메서드입니다.

매개변수
범위 현재 범위
보고
  • LeftShift의 새로운 인스턴스

공개 출력 <T> z ()