TensorFlow Lite 방언.
이 방언은 TensorFlow Lite 작업에 매핑됩니다.
불변 :
- 모든 값은 Tensor 유형입니다 (특히 스칼라는 0 차원 텐서를 사용하여 표현됩니다).
작동 정의
tfl.abs (TFL :: AbsOp)
절대 값 연산자
기술:
텐서 x
주어지면이 연산은 x
에있는 각 요소의 절대 값을 포함하는 텐서를 반환합니다. 예를 들어 x가 입력 요소이고 y가 출력 요소이면이 연산은 \(y = |x|\)을 계산합니다.
피연산자 :
-
x
: 모든 유형 값의 텐서
속성 :
결과 :
-
y
: 모든 유형 값의 텐서
tfl.add_n (TFL :: AddNOp)
add_n 연산자
기술:
모든 입력 텐서를 요소별로 추가합니다.
피연산자 :
-
inputs
: 모든 유형 값의 텐서
속성 :
결과 :
-
sum
: 모든 유형 값의 텐서
tfl.add (TFL :: AddOp)
더하기 연산자
기술:
요소 별 덧셈 연산.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
fused_activation_function | StringAttr | 통합 된 활성화 열거 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.arg_max (TFL :: ArgMaxOp)
ArgMax 연산자
기술:
텐서 차원에서 가장 큰 값을 가진 인덱스를 반환합니다.
피연산자 :
-
input
: 모든 유형 값의 텐서 -
dim
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
output_type | Attribute | 파생 된 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.arg_min (TFL :: ArgMinOp)
ArgMin 연산자
기술:
텐서 차원에서 가장 작은 값을 가진 인덱스를 반환합니다. "a = [1, 10, 26.9, 2.8, 166.32, 62.3] b = tf.math.argmin (input = a) c = tf.keras.backend.eval (비)
피연산자 :
-
input
: 모든 유형 값의 텐서 -
dim
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
output_type | Attribute | 파생 된 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.average_pool_2d (TFL :: AveragePool2DOp)
Average_pool_2d 연산자
기술:
입력에 대해 평균 풀링 작업을 수행합니다.
피연산자 :
-
input
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
filter_height | IntegerAttr | 32 비트 정수 속성 속성 |
filter_width | IntegerAttr | 32 비트 정수 속성 속성 |
padding | StringAttr | 패딩 열거 속성 |
stride_h | IntegerAttr | 32 비트 정수 속성 속성 |
stride_w | IntegerAttr | 32 비트 정수 속성 속성 |
fused_activation_function | StringAttr | 통합 된 활성화 열거 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.basic_lstm (TFL :: BasicLSTMOp)
기본 lstm 연산자
기술:
기본 LSTM 셀 연산자.
피연산자 :
-
data_input
: 모든 유형 값의 텐서 -
prev_activ_input
: 모든 유형 값의 텐서 -
weights_input
: 모든 유형 값의 텐서 -
biases_input
: 모든 유형 값의 텐서 -
prev_state_input
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
fused_activation_function | StringAttr | 통합 된 활성화 열거 속성 |
cell_clip | FloatAttr | 32 비트 부동 속성 속성 |
proj_clip | FloatAttr | 32 비트 부동 속성 속성 |
kernel_type | StringAttr | lstm 커널 유형 열거 형 케이스 BASIC 속성 |
결과 :
-
activ_output
: 모든 유형 값의 2D 텐서 -
state_output
: 모든 유형 값의 2D 텐서 -
concat_temp
: 모든 유형 값의 2D 텐서 -
activ_temp
: 모든 유형 값의 2D 텐서
tfl.batch_to_space_nd (TFL :: BatchToSpaceNdOp)
BatchToSpaceNd 연산자
기술:
이 작업은 "배치"차원 0을 공간 차원으로 재구성합니다.
피연산자 :
-
input
: 모든 유형 값의 텐서 -
block_shape
: 모든 유형 값의 텐서 -
indices
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.cast (TFL :: CastOp)
캐스트 연산자
기술:
입력 유형에서 출력 유형으로 입력을 캐스트합니다.
피연산자 :
-
input
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.ceil (TFL :: CeilOp)
Ceil 연산자
기술:
입력의 요소 별 ceil 값을 반환합니다.
피연산자 :
-
x
: 모든 유형 값의 텐서
속성 :
결과 :
-
y
: 모든 유형 값의 텐서
tfl.concatenation (TFL :: ConcatenationOp)
연결 연산자
기술:
한 차원을 따라 텐서를 연결합니다.
피연산자 :
-
values
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
axis | IntegerAttr | 32 비트 정수 속성 속성 |
fused_activation_function | StringAttr | 통합 된 활성화 열거 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.pseudo_const (TFL :: ConstOp)
상수 의사 연산.
기술:
TensorFlow Lite 언어의 상수 값을 나타냅니다. 이것은 실제 작업이 아니며 대신 버퍼로 낮아집니다.
op는 tf.Const와 동일한 유형의 속성을 모두 가질 수 있습니다 (예 : 불투명 TF 속성이 허용됨).
피연산자 :
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
value | ElementsAttr | 상수 벡터 / 텐서 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.conv_2d (TFL :: Conv2DOp)
컨볼 루션 연산자
기술:
입력에 대해 회선 연산을 수행합니다.
입력 : inputs[0]
: 필수 : 입력 활성화 텐서 inputs[1]
: 필수 : 필터 가중치 텐서 inputs[2]
: 선택 : 바이어스 텐서
피연산자 :
-
input
: 모든 유형 값의 텐서 -
filter
: 모든 유형 값의 텐서 -
bias
: 모든 유형 값의 텐서 또는 유형 없음
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
dilation_h_factor | IntegerAttr | 32 비트 정수 속성 속성 |
dilation_w_factor | IntegerAttr | 32 비트 정수 속성 속성 |
fused_activation_function | StringAttr | 통합 된 활성화 열거 속성 |
padding | StringAttr | 패딩 열거 속성 |
stride_h | IntegerAttr | 32 비트 정수 속성 속성 |
stride_w | IntegerAttr | 32 비트 정수 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.convolution_2d_transpose_bias (TFL :: Convolution2DTransposeBiasOp)
편향 연산자로 컨벌루션 전치
기술:
바이어스 추가 옵션과 함께 입력에 대해 전치 컨볼 루션 연산을 수행합니다. 이는 표준 런타임에서 지원되지 않는 사용자 지정 작업입니다.
Inputs:
`inputs[0]`: required: the input activation tensor
`inputs[1]`: required: the filter weight tensor
`inputs[2]`: optional: the bias tensor
피연산자 :
-
input
: 모든 유형 값의 텐서 -
filter
: 모든 유형 값의 텐서 -
bias
: 모든 유형 값의 텐서 또는 유형 없음
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
padding | StringAttr | 패딩 열거 속성 |
stride_h | IntegerAttr | 32 비트 정수 속성 속성 |
stride_w | IntegerAttr | 32 비트 정수 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.cos (TFL :: CosOp)
코사인 연산자
기술:
입력의 요소 별 코사인을 계산합니다.
피연산자 :
-
x
: 모든 유형 값의 텐서
속성 :
결과 :
-
y
: 모든 유형 값의 텐서
tfl.densify (TFL :: DensifyOp)
고밀도화 연산자
기술:
희소 텐서를 조밀 한 형식으로 변환합니다.
피연산자 :
-
input
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.depth_to_space (TFL :: DepthToSpaceOp)
DepthToSpace 연산자
기술:
데이터를 깊이에서 공간 데이터 블록으로 재 배열합니다. 이것은 SpaceToDepth의 역변환입니다. 보다 구체적으로,이 연산은 depth
차원의 값이 공간 블록에서 height
및 width
차원으로 이동되는 입력 텐서의 복사본을 출력합니다. attr block_size
는 입력 블록 크기와 데이터 이동 방법을 나타냅니다.
피연산자 :
-
input
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
block_size | IntegerAttr | 32 비트 정수 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.depthwise_conv_2d (TFL :: DepthwiseConv2DOp)
깊이로 분리 가능한 컨볼 루션 연산자
기술:
입력에 대해 회선 연산을 수행합니다.
입력 : inputs[0]
: 필수 : 입력 활성화 텐서 inputs[1]
: 필수 : 필터 가중치 텐서 inputs[2]
: 선택 : 바이어스 텐서
피연산자 :
-
input
: 모든 유형 값의 텐서 -
filter
: 모든 유형 값의 텐서 -
bias
: 모든 유형 값의 텐서 또는 유형 없음
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
dilation_h_factor | IntegerAttr | 32 비트 정수 속성 속성 |
dilation_w_factor | IntegerAttr | 32 비트 정수 속성 속성 |
fused_activation_function | StringAttr | 통합 된 활성화 열거 속성 |
padding | StringAttr | 패딩 열거 속성 |
stride_h | IntegerAttr | 32 비트 정수 속성 속성 |
stride_w | IntegerAttr | 32 비트 정수 속성 속성 |
depth_multiplier | IntegerAttr | 32 비트 정수 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.dequantize (TFL :: DequantizeOp)
역 양자화 연산자
기술:
양자화 매개 변수에 따라 양자화 된 정수 배열을 부동 소수점으로 변환합니다.
피연산자 :
-
input
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.div (TFL :: DivOp)
부문 연산자
기술:
요소 별 분할 작업.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
fused_activation_function | StringAttr | 통합 된 활성화 열거 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.elu (TFL :: EluOp)
지수 선형 단위 연산자
기술:
지수 선형 f (x)-> exp (x)-1 (x <0), x (x> = 0)를 계산합니다. 요소별로.
피연산자 :
-
x
: 모든 유형 값의 텐서
속성 :
결과 :
-
y
: 모든 유형 값의 텐서
tfl.embedding_lookup (TFL :: EmbeddingLookupOp)
검색 연산자 포함
기술:
임베딩 텐서 목록에서 ID를 찾습니다.
피연산자 :
-
lookup
: 모든 유형 값의 텐서 -
value
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.equal (TFL :: EqualOp)
같음 연산자
기술:
x == y 요소의 진리 요소를 반환합니다.
피연산자 :
-
x
: 모든 유형 값의 텐서 -
y
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.exp (TFL :: ExpOp)
자연 지수 연산자
기술:
입력에 대해 요소 별 자연 지수 연산을 수행합니다.
피연산자 :
-
x
: 모든 유형 값의 텐서
속성 :
결과 :
-
y
: 모든 유형 값의 텐서
tfl.expand_dims (TFL :: ExpandDimsOp)
텐서의 모양에 차원 1을 삽입합니다.
기술:
텐서 input
이 주어지면이 연산은 input
형태의 차원 인덱스 axis
에 차원 1을 삽입합니다. 차원 인덱스 axis
0에서 시작합니다. axis
음수를 지정하면 끝에서부터 역으로 계산됩니다.
이 작업은 단일 요소에 배치 차원을 추가하려는 경우에 유용합니다. 예를 들어 [height, width, channels]
모양의 단일 이미지가있는 경우 expand_dims(image, 0)
하여 1 개의 이미지를 배치하여 [1, height, width, channels]
모양을 만들 수 있습니다 [1, height, width, channels]
.
다른 예 :
# 't' is a tensor of shape [2]
shape(expand_dims(t, 0)) ==> [1, 2]
shape(expand_dims(t, 1)) ==> [2, 1]
shape(expand_dims(t, -1)) ==> [2, 1]
# 't2' is a tensor of shape [2, 3, 5]
shape(expand_dims(t2, 0)) ==> [1, 2, 3, 5]
shape(expand_dims(t2, 2)) ==> [2, 3, 1, 5]
shape(expand_dims(t2, 3)) ==> [2, 3, 5, 1]
이 작업에는 다음이 필요합니다.
-1-input.dims() <= dim <= input.dims()
이 작업은 크기 1의 차원을 제거하는 squeeze()
와 관련이 있습니다.
피연산자 :
-
input
: 모든 유형 값의 텐서 -
dim
: 모든 정수 유형의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.external_const (TFL :: ExternalConstOp)
외부 const op.
기술:
외부 const op에는 buffer_index
의 상수를 가리키는 buffer_index가 있습니다.
피연산자 :
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
buffer_index | IntegerAttr | 32 비트 정수 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.fake_quant (TFL :: FakeQuantOp)
FakeQuant 연산자
기술:
float 형 스칼라 min 및 max를 통해 float 유형의 '입력'텐서를 입력과 동일한 모양의 '출력'텐서로 가짜 양자화합니다.
피연산자 :
-
input
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
min | FloatAttr | 32 비트 부동 속성 속성 |
max | FloatAttr | 32 비트 부동 속성 속성 |
num_bits | IntegerAttr | 32 비트 정수 속성 속성 |
narrow_range | BoolAttr | bool 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.fill (TFL :: FillOp)
주어진 값으로 텐서를 채 웁니다.
기술:
주어진 값으로 텐서를 채 웁니다.
피연산자 :
-
dims
: 모든 유형 값의 텐서 -
value
: 모든 유형 값의 텐서
속성 :
결과 :
-
res
: 모든 유형 값의 텐서
tfl.floor_div (TFL :: FloorDivOp)
플로어 div 연산자
기술:
요소 별 플로어 div 작업.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.floor_mod (TFL :: FloorModOp)
분할 알림
기술:
요소 별 분할 알림 작업.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.floor (TFL :: FloorOp)
플로어 운영자
기술:
입력의 요소 별 하한값을 반환합니다.
피연산자 :
-
x
: 모든 유형 값의 텐서
속성 :
결과 :
-
y
: 모든 유형 값의 텐서
tfl.fully_connected (TFL :: FullyConnectedOp)
완전히 연결된 op
기술:
피연산자 :
-
input
: 모든 유형 값의 텐서 -
filter
: 모든 유형 값의 텐서 -
bias
: 모든 유형 값의 텐서 또는 유형 없음
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
fused_activation_function | StringAttr | 통합 된 활성화 열거 속성 |
weights_format | StringAttr | 완전 연결 옵션 가중치 형식 속성 |
keep_num_dims | BoolAttr | bool 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.gather_nd (TFL :: GatherNdOp)
Gather_nd 연산자
기술:
indices
지정된 모양을 사용하여 params
슬라이스를 Tensor로 수집합니다.
피연산자 :
-
params
: 모든 유형 값의 텐서 -
indices
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.gather (TFL :: GatherOp)
수집 연산자
기술:
indices
에 따라 params
축 axis
에서 슬라이스를 수집합니다.
피연산자 :
-
params
: 모든 유형 값의 텐서 -
indices
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
axis | IntegerAttr | 32 비트 정수 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.greater_equal (TFL :: GreaterEqualOp)
Greater_equal 연산자
기술:
요소 별 greater_equal 연산.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.greater (TFL :: GreaterOp)
더 큰 연산자
기술:
요소 별 더 큰 작업.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.hard_swish (TFL :: HardSwishOp)
Hardswish 활성화 기능.
기술:
하드 스윕 활성화 함수 f (x)-> (x * relu6 (x + 3)) / 6 요소별로 계산합니다.
피연산자 :
-
input
: 모든 유형 값의 텐서
속성 :
결과 :
-
out
: 모든 유형 값의 텐서
tfl.l2_normalization (TFL :: L2NormalizationOp)
L2 정규화 연산자
기술:
L2 정규화 작업
피연산자 :
-
input
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
fused_activation_function | StringAttr | 통합 된 활성화 열거 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.lstm (TFL :: LSTMOp)
전체 lstm 연산자
기술:
장단기 기억 장치 (LSTM) 반복 네트워크 계층. 기본 non-peephole 구현은 http://deeplearning.cs.cmu.edu/pdfs/Hochreiter97_lstm.pdf S. Hochreiter 및 J. Schmidhuber를 기반으로합니다. "긴 단기 기억". Neural Computation, 9 (8) : 1735-1780, 1997. Peephole 구현은 https://research.google.com/pubs/archive/43905.pdf Hasim Sak, Andrew Senior, Francoise Beaufays를 기반으로합니다. "대규모 음향 모델링을위한 장단기 기억 순환 신경망 아키텍처. INTERSPEECH, 2014. 입력 및 잊어 버림 게이트 (CIFG)의 결합은 다음을 기반으로합니다. http://arxiv.org/pdf/1503.04069.pdf Greff et al . "LSTM : A Search Space Odyssey"레이어 정규화는 https://arxiv.org/pdf/1607.06450.pdf Ba et al. "Layer Normalization"을 기반으로합니다.
피연산자 :
-
input
: 모든 유형 값의 텐서 -
input_to_input_weights
: 모든 유형 값의 텐서 또는 유형 없음 -
input_to_forget_weights
: 모든 유형 값의 텐서 -
input_to_cell_weights
: 모든 유형 값의 텐서 -
input_to_output_weights
: 모든 유형 값의 텐서 -
recurrent_to_input_weights
: 모든 유형 값의 텐서 또는 유형 없음 -
recurrent_to_forget_weights
: 모든 유형 값의 텐서 -
recurrent_to_cell_weights
: 모든 유형 값의 텐서 -
recurrent_to_output_weights
: 모든 유형 값의 텐서 -
cell_to_input_weights
: 모든 유형 값의 텐서 또는 유형 없음 -
cell_to_forget_weights
: 모든 유형 값의 텐서 또는 유형 없음 -
cell_to_output_weights
: 모든 유형 값의 텐서 또는 유형 없음 -
input_gate_bias
: 모든 유형 값의 텐서 또는 유형 없음 -
forget_gate_bias
: 모든 유형 값의 텐서 -
cell_bias
: 모든 유형 값의 텐서 -
output_gate_bias
: 모든 유형 값의 텐서 -
projection_weights
: 모든 유형 값의 텐서 또는 유형 없음 -
projection_bias
: 모든 유형 값의 텐서 또는 유형 없음 -
input_activation_state
: 상태 저장 텐서 -
input_cell_state
: 상태 저장 텐서 -
input_layer_norm_coefficients
: 모든 유형 값의 텐서 또는 유형 없음 -
forget_layer_norm_coefficients
: 모든 유형 값의 텐서 또는 유형 없음 -
cell_layer_norm_coefficients
: 모든 유형 값의 텐서 또는 유형 없음 -
output_layer_norm_coefficients
: 모든 유형 값의 텐서 또는 유형 없음
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
fused_activation_function | StringAttr | 통합 된 활성화 열거 속성 |
cell_clip | FloatAttr | 32 비트 부동 속성 속성 |
proj_clip | FloatAttr | 32 비트 부동 속성 속성 |
kernel_type | StringAttr | lstm 커널 유형 열거 형 케이스 FULL 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.leaky_relu (TFL :: LeakyReluOp)
Leaky Relu 연산자
기술:
요소 별 Leaky ReLU 연산자 x-> x> = 0? x : (알파 * x)
피연산자 :
-
input
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
alpha | FloatAttr | 32 비트 부동 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.less_equal (TFL :: LessEqualOp)
Less_equal 연산자
기술:
요소 별 less_equal 연산.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.less (TFL :: LessOp)
적은 연산자
기술:
요소별로 더 적은 작업.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.local_response_normalization (TFL :: LocalResponseNormalizationOp)
로컬 응답 정규화.
기술:
4 차원 input
텐서는 (마지막 차원을 따라) 1 차원 벡터의 3 차원 배열로 취급되며 각 벡터는 독립적으로 정규화됩니다. 주어진 벡터 내에서 각 성분은 depth_radius
내 입력 값의 가중 제곱합으로 depth_radius
. 상세히,
sqr_sum[a, b, c, d] =
sum(input[a, b, c, d - depth_radius : d + depth_radius + 1] ** 2)
output = input / (bias + alpha * sqr_sum) ** beta
자세한 내용은 Krizhevsky et al., 심층 컨볼 루션 신경망을 사용한 ImageNet 분류 (NIPS 2012)를 참조하십시오 .
피연산자 :
-
input
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
radius | IntegerAttr | 32 비트 정수 속성 속성 |
bias | FloatAttr | 32 비트 부동 속성 속성 |
alpha | FloatAttr | 32 비트 부동 속성 속성 |
beta | FloatAttr | 32 비트 부동 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.log (TFL :: LogOp)
자연 로그 연산자
기술:
입력에 대해 요소 별 자연 로그 연산을 수행합니다.
피연산자 :
-
x
: 모든 유형 값의 텐서
속성 :
결과 :
-
y
: 모든 유형 값의 텐서
tfl.log_softmax (TFL :: LogSoftmaxOp)
소프트 맥스 연산자 기록
기술:
다음 공식을 사용하여 요소 별 로그 소프트 맥스 활성화를 계산합니다.
입력-log (reduce_sum (exp (input), dim))
피연산자 :
-
input
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.logical_and (TFL :: LogicalAndOp)
논리 AND 연산자
기술:
요소 별 논리 AND 연산.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.logical_not (TFL :: LogicalNotOp)
논리 NOT 연산자
기술:
요소 별 논리 NOT 연산.
피연산자 :
-
lhs
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.logical_or (TFL :: LogicalOrOp)
논리 OR 연산자
기술:
요소 별 논리 OR 연산.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.logistic (TFL :: LogisticOp)
물류 운영자
기술:
입력의 요소 별 시그 모이 드를 계산합니다.
피연산자 :
-
x
: 모든 유형 값의 텐서
속성 :
결과 :
-
y
: 모든 유형 값의 텐서
tfl.matrix_diag (TFL :: MatrixDiagOp)
Returns a tensor with the provided diagonal and everything else padded with zeros.
기술:
대각선이 주어지면 대각선이있는 텐서를 반환하고 나머지는 모두 0으로 채 웁니다. 대각선에 k 차원 [I, J, K, ..., N]
이 있다고 가정하면 출력은 차원이 [I, J, K, ..., N, N]
인 랭크 k+1
의 텐서입니다 [I, J, K, ..., N, N]
여기서 : output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n].
피연산자 :
-
diagonal
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.matrix_set_diag (TFL :: MatrixSetDiagOp)
Returns a batched matrix tensor with new batched diagonal values.
기술:
input
및 diagonal
이 주어지면이 연산은 가장 안쪽 행렬의 주 대각선을 제외하고 input
과 모양과 값이 동일한 텐서를 반환합니다. 이것들은 diagonal
의 값으로 덮어 쓰여집니다.
피연산자 :
-
input
: 32 비트 부동 또는 32 비트 정수 또는 64 비트 정수 또는 8 비트 정수 또는 QI8 유형 또는 QI16 유형 또는 QUI8 유형 또는 TFLite uint8 유형 또는 TFLite quint8 유형 값의 텐서 -
diagonal
: 32 비트 부동 또는 32 비트 정수 또는 64 비트 정수 또는 8 비트 정수 또는 QI8 유형 또는 QI16 유형 또는 QUI8 유형 또는 TFLite uint8 유형 또는 TFLite quint8 유형 값의 텐서
속성 :
결과 :
-
output
: 32 비트 부동 또는 32 비트 정수 또는 64 비트 정수 또는 8 비트 정수 또는 QI8 유형 또는 QI16 유형 또는 QUI8 유형 또는 TFLite uint8 유형 또는 TFLite quint8 유형 값의 텐서
tfl.max_pool_2d (TFL :: MaxPool2DOp)
최대 풀 2D 작업
기술:
입력시 최대 풀 2D를 수행합니다.
입력 : inputs[0]
: 필수 : 입력 텐서
피연산자 :
-
input
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
padding | StringAttr | 패딩 열거 속성 |
stride_w | IntegerAttr | 32 비트 정수 속성 속성 |
stride_h | IntegerAttr | 32 비트 정수 속성 속성 |
filter_width | IntegerAttr | 32 비트 정수 속성 속성 |
filter_height | IntegerAttr | 32 비트 정수 속성 속성 |
fused_activation_function | StringAttr | 통합 된 활성화 열거 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.max_pooling_with_argmax_2d (TFL :: MaxPoolingWithArgMax2DOp)
argmax 연산이있는 최대 풀 2D
기술:
입력에 대해 최대 풀링을 수행하고 최대 값과 인덱스를 모두 출력합니다. 각 인덱스는 "filter_w"x "filter_h"크기의 하위 배열에있는 평면화 된 인덱스입니다. 이것은 표준 런타임에서 지원되지 않는 사용자 지정 작업입니다.
입력 : inputs[0]
: 필수 : 입력 활성화 텐서
피연산자 :
-
input
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
padding | StringAttr | 패딩 열거 속성 |
stride_w | IntegerAttr | 32 비트 정수 속성 속성 |
stride_h | IntegerAttr | 32 비트 정수 속성 속성 |
filter_w | IntegerAttr | 32 비트 정수 속성 속성 |
filter_h | IntegerAttr | 32 비트 정수 속성 속성 |
결과 :
-
value
: 모든 유형 값의 텐서 -
indices
: 모든 유형 값의 텐서
tfl.max_unpooling_2d (TFL :: MaxUnpooling2DOp)
Max Unpool 2D
기술:
최대 풀 해제 작업을 수행합니다. 어느 정도 이것은 최대 풀링의 역 동작입니다. 입력 활성화 텐서의 요소는 입력 인덱스에 의해 지정된 위치에 저장됩니다. 이는 표준 런타임에서 지원되지 않는 사용자 지정 작업입니다.
입력 : inputs[0]
: 필수 : 입력 활성화 텐서 inputs[1]
: 필수 : 입력 인덱스
피연산자 :
-
input
: 모든 유형 값의 텐서 -
indices
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
padding | StringAttr | 패딩 열거 속성 |
stride_w | IntegerAttr | 32 비트 정수 속성 속성 |
stride_h | IntegerAttr | 32 비트 정수 속성 속성 |
filter_w | IntegerAttr | 32 비트 정수 속성 속성 |
filter_h | IntegerAttr | 32 비트 정수 속성 속성 |
결과 :
-
outputs
: 모든 유형 값의 텐서
tfl.maximum (TFL :: MaximumOp)
최대 연산자
기술:
요소 별 최대 작업.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
결과 :
-
max
: 모든 유형 값의 텐서
tfl.mean (TFL :: MeanOp)
평균 연산자
기술:
텐서 차원에서 요소의 평균을 계산합니다. 축에 주어진 차원을 따라 input_tensor를 줄입니다. keepdims가 참이 아니면 텐서의 순위는 축의 각 항목에 대해 1 씩 감소합니다. keepdims가 참이면 축소 된 치수는 길이 1로 유지됩니다.
피연산자 :
-
input
: 모든 유형 값의 텐서 -
axis
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
keep_dims | BoolAttr | bool 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.minimum (TFL :: MinimumOp)
최소 연산자
기술:
요소 별 최소 작업.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
결과 :
-
min
: 모든 유형 값의 텐서
tfl.mirror_pad (TFL :: MirrorPadOp)
MirrorPad 연산자. 미러링 된 값으로 텐서를 채 웁니다.
기술:
이 연산은 지정한 패딩에 따라 미러링 된 값으로 입력을 채 웁니다. paddings는 모양이 [n, 2] 인 정수 텐서입니다. 여기서 n은 입력 순위입니다. 입력의 각 차원 D에 대해 paddings [D, 0]은 해당 차원의 입력 내용 전에 추가 할 값 수를 나타내고 paddings [D, 1]은 해당 차원의 입력 내용 뒤에 추가 할 값 수를 나타냅니다.
paddings [D, 0] 및 paddings [D, 1] 모두 copy_border가 true이면 (각각 false 인 경우) input.dim_size (D) (또는 input.dim_size (D)-1)보다 크지 않아야합니다.
출력의 각 차원 D의 패딩 된 크기는 다음과 같습니다.
paddings (D, 0) + input.dim_size (D) + paddings (D, 1)
피연산자 :
-
input
: 모든 유형 값의 텐서 -
pad
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
mode | StringAttr | 미러 패드 열거 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.mul (TFL :: MulOp)
곱셈 연산자
기술:
요소 별 곱셈 연산.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
fused_activation_function | StringAttr | 통합 된 활성화 열거 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.neg (TFL :: NegOp)
부정 연산자
기술:
요소 별 입력 부정을 계산합니다.
피연산자 :
-
x
: 모든 유형 값의 텐서
속성 :
결과 :
-
y
: 모든 유형 값의 텐서
tfl.non_max_suppression_v4 (TFL :: NonMaxSuppressionV4Op)
탐욕스럽게 점수의 내림차순으로 경계 상자의 하위 집합을 선택합니다.
기술:
IOU (Intersection-over-union)가 높은 상자 잘라내 기는 이전에 선택한 상자와 겹칩니다. score_threshold
미만의 점수를 가진 경계 상자가 제거됩니다. 경계 상자는 [y1, x1, y2, x2]로 제공됩니다. 여기서 (y1, x1) 및 (y2, x2)는 대각선 상자 모서리 쌍의 좌표이며 좌표는 정규화 (예 : 간격 [0, 1]) 또는 절대. 이 알고리즘은 원점이 좌표계에있는 위치와 무관하며보다 일반적으로 좌표계의 직교 변환 및 변환에 불변합니다. 따라서 좌표계를 변환하거나 반사하면 알고리즘에 의해 동일한 상자가 선택됩니다. 이 작업의 출력은 선택한 상자를 나타내는 경계 상자의 입력 컬렉션으로 인덱싱되는 정수 집합입니다. 선택한 인덱스에 해당하는 경계 상자 좌표는 tf.gather operation
사용하여 얻을 수 있습니다. 예 : selected_indices = tf.image.non_max_suppression_v2 (boxes, scores, max_output_size, iou_threshold, score_threshold) selected_boxes = tf.gather (boxes, selected_indices)
피연산자 :
-
boxes
: 모든 유형 값의 텐서 -
scores
: 모든 유형 값의 텐서 -
max_output_size
: 모든 유형 값의 텐서 -
iou_threshold
: 모든 유형 값의 텐서 -
score_threshold
: 모든 유형 값의 텐서
속성 :
결과 :
-
selected_indices
: 모든 유형 값의 텐서 -
valid_outputs
: 모든 유형 값의 텐서
tfl.non_max_suppression_v5 (TFL :: NonMaxSuppressionV5Op)
탐욕스럽게 점수의 내림차순으로 경계 상자의 하위 집합을 선택합니다.
기술:
IOU (Intersection-over-union)가 높은 상자 잘라내 기는 이전에 선택한 상자와 겹칩니다. score_threshold
미만의 점수를 가진 경계 상자가 제거됩니다. 경계 상자는 [y1, x1, y2, x2]로 제공됩니다. 여기서 (y1, x1) 및 (y2, x2)는 대각선 상자 모서리 쌍의 좌표이며 좌표는 정규화 (예 : 간격 [0, 1]) 또는 절대. 이 알고리즘은 좌표계에서 원점이 어디에 있는지에 대해 알 수 없으며보다 일반적으로 좌표계의 직교 변환 및 변환에 불변합니다. 따라서 좌표계를 변환하거나 반사하면 알고리즘에 의해 동일한 상자가 선택됩니다. 이 작업의 출력은 선택한 상자를 나타내는 경계 상자의 입력 컬렉션으로 인덱싱되는 정수 집합입니다. 선택한 인덱스에 해당하는 경계 상자 좌표는 tf.gather operation
사용하여 얻을 수 있습니다. 예 : selected_indices = tf.image.non_max_suppression_v2 (boxes, scores, max_output_size, iou_threshold, score_threshold) selected_boxes = tf.gather (boxes, selected_indices)이 작업은 Soft-NMS (가우스 가중치 포함) 모드도 지원합니다 (참조 : Bodla et al , https://arxiv.org/abs/1704.04503) 여기서 상자는 다른 겹치는 상자의 점수를 직접 잘라 내지 않고 줄입니다. 이 Soft-NMS 모드를 활성화하려면 soft_nms_sigma
매개 변수를 0보다 크게 설정하십시오.
피연산자 :
-
boxes
: 모든 유형 값의 텐서 -
scores
: 모든 유형 값의 텐서 -
max_output_size
: 모든 유형 값의 텐서 -
iou_threshold
: 모든 유형 값의 텐서 -
score_threshold
: 모든 유형 값의 텐서 -
soft_nms_sigma
: 모든 유형 값의 텐서
속성 :
결과 :
-
selected_indices
: 모든 유형 값의 텐서 -
selected_scores
: 모든 유형 값의 텐서 -
valid_outputs
: 모든 유형 값의 텐서
tfl.not_equal (TFL :: NotEqualOp)
Not_equal 연산자
기술:
요소 별 not_equal 연산.
피연산자 :
-
lhs
: 모든 유형 값의 텐서 -
rhs
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.NumericVerify (TFL :: NumericVerifyOp)
두 피연산자의 숫자를 확인합니다.
기술:
NumericVerify 작업은 두 활성화의 숫자를 확인하기위한 디버깅 작업입니다. TFLite의 사용자 지정 작업입니다.
피연산자 :
-
input
: 모든 유형 값의 텐서 -
ref
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
tolerance | FloatAttr | 32 비트 부동 속성 속성 |
결과 :
tfl.one_hot (TFL :: OneHotOp)
OneHot 연산자
기술:
원-핫 텐서를 반환합니다 .Returns a one-hot tensor. 인덱스의 indices
표시되는 위치는 값 on_value
를 사용하고 다른 모든 위치는 값 off_value
합니다.
입력 indices
가 순위 N
이면 출력은 순위 N+1
이고 새 축은 차원 axis
생성됩니다 (기본값 : 새 축이 끝에 추가됨).
피연산자 :
-
indices
: 모든 유형 값의 텐서 -
depth
: 모든 유형 값의 텐서 -
on_value
: 모든 유형 값의 텐서 -
off_value
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
axis | IntegerAttr | 32 비트 정수 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.prelu (TFL :: PReluOp)
매개 변수화 된 Relu 연산자
기술:
매개 변수화 된 Relu 연산자 x-> x> = 0? x : (alpha * x) 여기서 alpha는 학습 가능한 텐서입니다. 알파는 배치 차원이 없으므로 입력보다 순위가 하나 더 낮아야하며 다른 차원은 입력 또는 크기 1과 같은 크기 여야합니다. 두 번째 경우에 브로드 캐스트됩니다.
피연산자 :
-
input
: 모든 유형 값의 텐서 -
alpha
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.pack (TFL :: PackOp)
차원을 따라 텐서 목록을 하나의 텐서로 압축합니다.
기술:
values_count
R
텐서 목록을 하나의 values_count
(R+1)
텐서로 values_count
합니다.
values
의 values_count
텐서를 axis
차원을 따라 패킹하여 values
각 텐서보다 순위가 1 높은 텐서로 values_count
합니다.
모양의 텐서 목록이 주어지면 (A, B, C)
;
axis == 0
이면 output
텐서는 (N, A, B, C)
모양을 갖습니다. axis == 1
이면 output
텐서는 (A, N, B, C)
모양을 갖습니다. 기타.
예를 들면 :
# 'x' is [1, 4]
# 'y' is [2, 5]
# 'z' is [3, 6]
pack([x, y, z]) => [[1, 4], [2, 5], [3, 6]] # Pack along first dim.
pack([x, y, z], axis=1) => [[1, 2, 3], [4, 5, 6]]
이것은 unpack
과 반대입니다.
피연산자 :
-
values
: 모든 유형 값의 텐서
속성 :
속성 | MLIR 유형 | 기술 |
---|---|---|
values_count | IntegerAttr | 32 비트 정수 속성 속성 |
axis | IntegerAttr | 32 비트 정수 속성 속성 |
결과 :
-
output
: 모든 유형 값의 텐서
tfl.pad (TFL :: PadOp)
패딩 연산자
기술:
이 연산은 지정한 paddings
에 따라 input
을 0으로 채 paddings
. paddings
는 [Dn, 2]
모양의 정수 텐서입니다. 여기서 n은 input
의 순위입니다. input
각 차원 D에 대해 paddings[D, 0]
은 해당 차원의 input
내용 전에 추가 할 0 수를 나타내고 paddings[D, 1]
은 해당 차원의 input
내용 뒤에 추가 할 0 수를 나타냅니다.
출력의 각 차원 D의 패딩 된 크기는 다음과 같습니다.
paddings(D, 0) + input.dim_size(D) + paddings(D, 1)
예를 들면 :
# 't' is [[1, 1], [2, 2]]
# 'paddings' is [[1, 1], [2, 2]]
# rank of 't' is 2
pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
[0, 0, 1, 1, 0, 0]
[0, 0, 2, 2, 0, 0]
[0, 0, 0, 0, 0, 0]]
피연산자 :
-
input
: 모든 유형 값의 텐서 -
padding
: 모든 유형 값의 텐서
속성 :
결과 :
-
output
: 모든 유형 값의 텐서
tfl.padv2 (TFL :: PadV2Op)
패딩 연산자 v2
기술:
이 작업은 지정한 paddings
및 constant_values
에 따라 input
을 채 paddings
. paddings
는 형태가 [Dn, 2]
인 정수 텐서이며, 여기서 n은 input
의 순위입니다. input
각 차원 D에 대해 paddings[D, 0]
은 해당 차원의 input
내용 앞에 추가 할 0의 수를 나타내고 paddings[D, 1]
은 해당 차원의 input
내용 뒤에 추가 할 0의 수를 나타냅니다. constant_values
동일한 타입의 스칼라 텐서 input
패딩에 사용하는 값을 나타내는 input
.
출력의 각 차원 D의 패딩 된 크기는 다음과 같습니다.
paddings(D, 0) + input.dim_size(D) + paddings(D, 1)
예를 들면 :
# 't' is [[1, 1], [2, 2]]
# 'paddings' is [[1, 1], [2, 2]]
# rank of 't' is 2
pad(t, paddings) ==> [[0, 0, 0, 0, 0, 0]
[0, 0, 1, 1, 0, 0]
[0, 0, 2, 2, 0, 0]
[0, 0, 0, 0, 0, 0]]
피연산자 :
-
input
: 모든 유형 값의 텐서 -
padding
: tensor of any type values -
constant_values
: tensor of any type values
Attributes:
Results:
-
output
: tensor of any type values
tfl.pow (TFL::PowOp)
Power operator
Description:
Element-wise power operation.
Operands:
-
lhs
: tensor of any type values -
rhs
: tensor of any type values
Attributes:
Results:
-
output
: tensor of any type values
tfl.pseudo_qconst (TFL::QConstOp)
Quantized constant pseudo op
Description:
Represents a quantized constant value in TensorFlow Lite dialect. This is not an actual operation and it will be lowered to buffer instead. The quantization parameters are stored as a type attribute in this constant.
Operands:
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
qtype | TypeAttr | Tensor type attribute attribute |
value | ElementsAttr | constant vector/tensor attribute attribute |
Results:
-
output
: tensor of any type values
tfl.quantize (TFL::QuantizeOp)
Quantize operator
Description:
Converts floating point tensors to quantized integer tensors according to the quantization parameters defined in the type attribute.
Operands:
-
input
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
qtype | TypeAttr | Tensor type attribute attribute |
Results:
-
output
: tensor of any type values
tfl.range (TFL::RangeOp)
Range operator
Description:
Returns a 1D tensor defined by a sequence from start
to limit
with a given delta
.
Operands:
-
start
: tensor of any type values -
limit
: tensor of any type values -
delta
: tensor of any type values
Attributes:
Results:
-
result
: tensor of any type values
tfl.rank (TFL::RankOp)
Rank operator.
Description:
Returns the rank of a tensor.
Operands:
-
input
: tensor of any type values
Attributes:
Results:
-
output
: tensor of any integer type
tfl.reduce_any (TFL::ReduceAnyOp)
Computes the "logical or" of elements across dimensions of a tensor.
Description:
Reduces input
along the dimensions given in axis
. Unless keep_dims
is true, the rank of the tensor is reduced by 1 for each entry in axis
. If keep_dims
is true, the reduced dimensions are retained with length 1.
Operands:
-
input
: tensor of any type values -
reduction_indices
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
keep_dims | BoolAttr | bool attribute attribute |
Results:
-
output
: tensor of any type values
tfl.reduce_max (TFL::ReduceMaxOp)
Max-reduction operator
Description:
Computes the max reduction along the specified axes
Operands:
-
input
: tensor of any type values -
axes
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
keep_dims | BoolAttr | bool attribute attribute |
Results:
- «unnamed»: tensor of any type values
tfl.reduce_min (TFL::ReduceMinOp)
Min-reduction operator
Description:
Computes the min reduction along the specified axes
Operands:
-
input
: tensor of any type values -
axes
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
keep_dims | BoolAttr | bool attribute attribute |
Results:
- «unnamed»: tensor of any type values
tfl.reduce_prod (TFL::ReduceProdOp)
Prod-reduction operator
Description:
Computes the product along the specified axes
Operands:
-
input
: tensor of any type values -
axes
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
keep_dims | BoolAttr | bool attribute attribute |
Results:
- «unnamed»: tensor of any type values
tfl.relu_n1_to_1 (TFL::Relu1Op)
Relu1 operator
Description:
Element-wise Relu1 operator x -> max(-1, min(1, x))
Operands:
-
x
: tensor of any type values
Attributes:
Results:
-
y
: tensor of any type values
tfl.relu6 (TFL::Relu6Op)
Relu6 operator
Description:
Element-wise Relu6 operator x -> max(0, min(6, x))
Operands:
-
x
: tensor of any type values
Attributes:
Results:
-
y
: tensor of any type values
tfl.relu (TFL::ReluOp)
Relu operator
Description:
Element-wise Relu operator x -> max(0, x)
Operands:
-
x
: tensor of any type values
Attributes:
Results:
-
y
: tensor of any type values
tfl.reshape (TFL::ReshapeOp)
Reshape operator
Description:
Produces a tensor with the same values but different static shape defined by the output type.
Operands:
-
input
: tensor of any type values -
shape
: tensor of any type values
Attributes:
Results:
-
output
: tensor of any type values
tfl.resize_bilinear (TFL::ResizeBilinearOp)
ResizeBilinear Op
Description:
Resize images
to size
using bilinear interpolation.
Operands:
-
input
: tensor of any type values -
size
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
align_corners | BoolAttr | bool attribute attribute |
half_pixel_centers | BoolAttr | bool attribute attribute |
Results:
-
output
: tensor of any type values
tfl.resize_nearest_neighbor (TFL::ResizeNearestNeighborOp)
ResizeNearestNeighbor Op
Description:
Resize images
to size
using nearest neighbor interpolation.
Operands:
-
input
: tensor of any type values -
size
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
align_corners | BoolAttr | bool attribute attribute |
Results:
-
output
: tensor of any type values
tfl.reverse_sequence (TFL::ReverseSequenceOp)
Reverses variable length slices.
Description:
This op first slices input
along the dimension batch_dim
, and for each slice i
, reverses the first seq_lengths[i]
elements along the dimension seq_dim
.
The elements of seq_lengths
must obey seq_lengths[i] <= input.dims[seq_dim]
, and seq_lengths
must be a vector of length input.dims[batch_dim]
.
The output slice i
along dimension batch_dim
is then given by input slice i
, with the first seq_lengths[i]
slices along dimension seq_dim
reversed.
Operands:
-
input
: tensor of any type values -
seq_lengths
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
seq_dim | IntegerAttr | 32-bit integer attribute attribute |
batch_dim | IntegerAttr | 32-bit integer attribute attribute |
Results:
-
output
: tensor of any type values
tfl.reverse_v2 (TFL::ReverseV2Op)
ReverseV2 Operator
Description:
Reverses specific dimensions of a tensor.
Given a tensor, and a int32/int64 tensor axis representing the set of dimensions of tensor to reverse. This operation reverses each dimension i for which there exists j st axis[j] == i.
Args: tensor: A Tensor. Must be one of the following types: uint8, int16, int32, int64, float32, bool Up to 8-D.
axis: A Tensor. Must be one of the following types: int32, int64. with only 1 element which is the axis index. TODO: Add support for multiple elements.
Operands:
-
input
: tensor of any type values -
axis
: tensor of any type values
Attributes:
Results:
-
output
: tensor of any type values
tfl.round (TFL::RoundOp)
Round operator
Description:
Rounds the values of a tensor to the nearest integer, element-wise.
Operands:
-
x
: tensor of any type values
Attributes:
Results:
-
y
: tensor of any type values
tfl.rsqrt (TFL::RsqrtOp)
Reciprocal of square root operator
Description:
Computes element-wise reverse square root of input
Operands:
-
x
: tensor of any type values
Attributes:
Results:
-
y
: tensor of any type values
tfl.svdf (TFL::SVDFOp)
Single value decomposition filter operator
Description:
The SVDF op is a decomposition of a densely connected op into low rank filters. For details: https://research.google.com/pubs/pub43813.html https://arxiv.org/abs/1812.02802
Operands:
-
input
: tensor of any type values -
feature_weights
: tensor of any type values -
time_weights
: tensor of any type values -
input_gate_bias
: tensor of any type values or none type -
activation_state
: stateful tensor
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
rank | IntegerAttr | 32-bit integer attribute attribute |
fused_activation_function | StringAttr | fused activation enum attribute |
Results:
-
output
: tensor of any type values
tfl.segment_sum (TFL::SegmentSumOp)
SegmentSum operator
Description:
Computes the sum along segments of a tensor.
Operands:
-
data
: tensor of any type values -
segment_ids
: tensor of any type values
Attributes:
Results:
-
output
: tensor of any type values
tfl.select (TFL::SelectOp)
Select operator
Description:
Select values of 'x' if the corresponding value of 'condition' is true or the value of 'y' if false. There are valid condition input sizes:
- Either the same shape (in which case the select is elementwise), or
- condition must be Rank 1 and match over the first dimension.
Operands:
-
condition
: tensor of any type values -
x
: tensor of any type values -
y
: tensor of any type values
Attributes:
Results:
-
output
: tensor of any type values
tfl.select_v2 (TFL::SelectV2Op)
SelectV2 operator
Description:
Select values of 'x' if the corresponding value of 'condition' is true or the value of 'y' if false. There are valid condition input sizes:
- Either the same shape (in which case the select is elementwise), or
- Broadcastable shapes between 'condition', 'x' and 'y'.
Operands:
-
condition
: tensor of any type values -
x
: tensor of any type values -
y
: tensor of any type values
Attributes:
Results:
-
output
: tensor of any type values
tfl.shape (TFL::ShapeOp)
Shape operator
Description:
Returns the shape of a tensor.
Operands:
-
input
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
out_type | Attribute | derived attribute attribute |
Results:
-
output
: tensor of any type values
tfl.sin (TFL::SinOp)
Sine operator
Description:
Computes element-wise Sine of input
Operands:
-
x
: tensor of any type values
Attributes:
Results:
-
y
: tensor of any type values
tfl.slice (TFL::SliceOp)
Return a slice from 'input'.
Description:
The output tensor is a tensor with dimensions described by 'size' whose values are extracted from 'input' starting at the offsets in 'begin'.
begin
is zero-based; size
is one-based. If size[i] is -1, all remaining elements in dimension i are included in the slice. In other words, this is equivalent to setting: size[i] = input.dim_size(i) - begin[i]
Requirements : 0 <= begin[i] <= begin[i] + size[i] <= Di for i in [0, n)
Operands:
-
input
: tensor of any type values -
begin
: tensor of any type values -
size
: tensor of any type values
Attributes:
Results:
-
output
: tensor of any type values
tfl.softmax (TFL::SoftmaxOp)
Softmax operator
Description:
Computes element-wise softmax activations with the following formula
exp(input) / tf.reduce_sum(exp(input * beta), dim)
Operands:
-
input
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
beta | FloatAttr | 32-bit float attribute attribute |
Results:
-
output
: tensor of any type values
tfl.space_to_batch_nd (TFL::SpaceToBatchNdOp)
SpaceToBatchNd operator
Description:
This operation reshapes space dimensions into the "batch" dimension 0
Operands:
-
input
: tensor of any type values -
block_shape
: tensor of any type values -
paddings
: tensor of any type values
Attributes:
Results:
-
output
: tensor of any type values
tfl.space_to_depth (TFL::SpaceToDepthOp)
SpaceToDepth operator
Description:
Rearranges blocks of spatial data, into depth. More specifically, this op outputs a copy of the input tensor where values from the height
and width
dimensions are moved to the depth
dimension. block_size
indicates the input block size.
Operands:
-
input
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
block_size | IntegerAttr | 32-bit integer attribute attribute |
Results:
-
output
: tensor of any type values
tfl.pseudo_sparse_const (TFL::SparseConstOp)
Sparse constant pseudo op.
Description:
Represents a sparse constant value in TensorFlow Lite dialect. This is not an actual operation and it will be lowered to buffer instead.
Operands:
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
value | ElementsAttr | constant vector/tensor attribute attribute |
s_param | TFL::SparsityParameterAttr | Sparsity parameter. attribute |
Results:
-
output
: tensor of any type values
tfl.pseudo_sparse_qconst (TFL::SparseQConstOp)
Sparse quantized constant pseudo op
Description:
Represents a sparse quantized constant value in TensorFlow Lite dialect. This is not an actual operation and it will be lowered to buffer instead. The quantization parameters are stored as a type attribute in this constant.
Operands:
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
qtype | TypeAttr | Tensor type attribute attribute |
value | ElementsAttr | constant vector/tensor attribute attribute |
s_param | TFL::SparsityParameterAttr | Sparsity parameter. attribute |
Results:
-
output
: tensor of any type values
tfl.sparse_to_dense (TFL::SparseToDenseOp)
Converts a sparse representation into a dense tensor.
Description:
Builds an array dense
with shape output_shape
such that
# If sparse_indices is scalar
dense[i] = (i == sparse_indices ? sparse_values : default_value)
# If sparse_indices is a vector, then for each i
dense[sparse_indices[i]] = sparse_values[i]
# If sparse_indices is an n by d matrix, then for each i in [0, n)
dense[sparse_indices[i][0], ..., sparse_indices[i][d-1]] = sparse_values[i]
All other values in dense
are set to default_value
. If sparse_values
is a scalar, all sparse indices are set to this single value.
Indices should be sorted in lexicographic order, and indices must not contain any repeats. If validate_indices
is true, these properties are checked during execution.
Operands:
-
sparse_indices
: tensor of any type values -
output_shape
: tensor of any type values -
sparse_values
: tensor of any type values -
default_value
: tensor of any type values
Attributes:
Results:
-
dense
: tensor of any type values
tfl.split (TFL::SplitOp)
Splits a tensor into num_split
tensors along one dimension.
Description:
Splits the value
tensor along split_dim
into a number of sub-tensors with same shape as the original one, except for split_dim
. Same as tf.Split.
Operands:
-
split_dim
: tensor of any type values -
value
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
num_splits | IntegerAttr | positive 32-bit integer attribute attribute |
Results:
-
outputs
: tensor of any type values
tfl.split_v (TFL::SplitVOp)
Splits a tensor into num_split
tensors along one dimension.
Description:
Splits the value
tensor along split_dim
into a number of sub-tensors with same shape as the original one, except for split_dim
. The grouping of the resultant sub-tensors is decided by size-splits
. Same as tf.SplitV.
Operands:
-
value
: tensor of any type values -
size_splits
: 1D tensor of 32-bit integer values -
split_dim
: 0D tensor of 32-bit integer values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
num_splits | IntegerAttr | positive 32-bit integer attribute attribute |
Results:
-
outputs
: tensor of any type values
tfl.sqrt (TFL::SqrtOp)
Square root operator
Description:
Computes element-wise Square root of input
Operands:
-
x
: tensor of any type values
Attributes:
Results:
-
y
: tensor of any type values
tfl.square (TFL::SquareOp)
Square operator
Description:
Computes element-wise Square of input
Operands:
-
x
: tensor of any type values
Attributes:
Results:
-
y
: tensor of any type values
tfl.squared_difference (TFL::SquaredDifferenceOp)
Squared difference operator
Description:
Element-wise squared difference operation.
Operands:
-
lhs
: tensor of any type values -
rhs
: tensor of any type values
Attributes:
Results:
-
output
: tensor of any type values
tfl.squeeze (TFL::SqueezeOp)
Removes dimensions of size 1 from the shape of a tensor.
Description:
Given a tensor input
, this operation returns a tensor of the same type with all dimensions of size 1 removed. If you don't want to remove all size 1 dimensions, you can remove specific size 1 dimensions by specifying axis
.
For example:
# 't' is a tensor of shape [1, 2, 1, 3, 1, 1]
shape(squeeze(t)) ==> [2, 3]
Or, to remove specific size 1 dimensions:
# 't' is a tensor of shape [1, 2, 1, 3, 1, 1]
shape(squeeze(t, [2, 4])) ==> [1, 2, 3, 1]
Operands:
-
input
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
squeeze_dims | ArrayAttr | 64-bit integer array attribute attribute |
Results:
-
output
: tensor of any type values
tfl.strided_slice (TFL::StridedSliceOp)
StridedSlice Op
Description:
Return a strided slice from input
.
Operands:
-
input
: tensor of any type values -
begin
: tensor of any type values -
end
: tensor of any type values -
strides
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
begin_mask | IntegerAttr | 32-bit integer attribute attribute |
end_mask | IntegerAttr | 32-bit integer attribute attribute |
ellipsis_mask | IntegerAttr | 32-bit integer attribute attribute |
new_axis_mask | IntegerAttr | 32-bit integer attribute attribute |
shrink_axis_mask | IntegerAttr | 32-bit integer attribute attribute |
Results:
-
output
: tensor of any type values
tfl.sub (TFL::SubOp)
Subtraction operator
Description:
Element-wise subtraction operation.
Operands:
-
lhs
: tensor of any type values -
rhs
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
fused_activation_function | StringAttr | fused activation enum attribute |
Results:
-
output
: tensor of any type values
tfl.sum (TFL::SumOp)
Sum operator
Description:
Computes the sum reduction along the specified axes
Operands:
-
input
: tensor of any type values -
axes
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
keep_dims | BoolAttr | bool attribute attribute |
Results:
- «unnamed»: tensor of any type values
tfl.tanh (TFL::TanhOp)
Hyperbolic tangent operator
Description:
Computes element-wise Hyperbolic tangent of input
Operands:
-
x
: tensor of any type values
Attributes:
Results:
-
y
: tensor of any type values
tfl.tile (TFL::TileOp)
Tile operator.
Description:
Constructs a tensor by tiling a given tensor.
This operation creates a new tensor by replicating input multiples times. The output tensor's i'th dimension has input.dims(i) * multiples[i] elements, and the values of input are replicated multiples[i] times along the 'i'th dimension. For example, tiling [abcd] by [2] produces [abcdabcd].
Operands:
-
input
: tensor of any type values -
multiples
: tensor of any type values
Attributes:
Results:
-
output
: tensor of any type values
tfl.topk_v2 (TFL::TopKV2Op)
TopK operator
Description:
Returns the top k
largest element along each last dimensional slice of input
and the indices of values within the last dimension of the input tensor.
Operands:
-
input
: tensor of any type values -
k
: tensor of any type values
Attributes:
Results:
-
values
: tensor of any type values -
indices
: tensor of any type values
tfl.transpose_conv (TFL::TransposeConvOp)
Transpose convolution operator
Description:
Performs transpose convolution operation on input.
Operands:
-
output_shape
: 1D tensor of any type values -
weights
: tensor of any type values -
input
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
padding | StringAttr | padding enum attribute |
stride_h | IntegerAttr | 32-bit integer attribute attribute |
stride_w | IntegerAttr | 32-bit integer attribute attribute |
Results:
-
output
: tensor of any type values
tfl.transpose (TFL::TransposeOp)
Transpose operator
Description:
Returns the Transpose of x
Operands:
-
x
: tensor of any type values -
perm
: tensor of any type values
Attributes:
Results:
-
y
: tensor of any type values
tfl.unidirectional_sequence_lstm (TFL::UnidirectionalSequenceLSTMOp)
Unidirectional sequence lstm operator
Description:
A recurrent neural network specified by an LSTM cell. This Op supports unrolling the input along the time or batch dimensions, and implements the following operation for each element in the sequence s = 1...sequence_length: outputs[s] = state = activation(LSTMOp(inputs[s]))
where LSTMOp is LSTM TF Lite Op and the “activation” is the function passed as the “fused_activation_function” argument (if not “NONE”).
Operands:
-
input
: tensor of any type values -
input_to_input_weights
: tensor of any type values or none type -
input_to_forget_weights
: tensor of any type values -
input_to_cell_weights
: tensor of any type values -
input_to_output_weights
: tensor of any type values -
recurrent_to_input_weights
: tensor of any type values or none type -
recurrent_to_forget_weights
: tensor of any type values -
recurrent_to_cell_weights
: tensor of any type values -
recurrent_to_output_weights
: tensor of any type values -
cell_to_input_weights
: tensor of any type values or none type -
cell_to_forget_weights
: tensor of any type values or none type -
cell_to_output_weights
: tensor of any type values or none type -
input_gate_bias
: tensor of any type values or none type -
forget_gate_bias
: tensor of any type values -
cell_bias
: tensor of any type values -
output_gate_bias
: tensor of any type values -
projection_weights
: tensor of any type values or none type -
projection_bias
: tensor of any type values or none type -
input_activation_state
: stateful tensor -
input_cell_state
: stateful tensor -
input_layer_norm_coefficients
: tensor of any type values or none type -
forget_layer_norm_coefficients
: tensor of any type values or none type -
cell_layer_norm_coefficients
: tensor of any type values or none type -
output_layer_norm_coefficients
: tensor of any type values or none type
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
fused_activation_function | StringAttr | fused activation enum attribute |
cell_clip | FloatAttr | 32-bit float attribute attribute |
proj_clip | FloatAttr | 32-bit float attribute attribute |
time_major | BoolAttr | bool attribute attribute |
Results:
-
output
: tensor of any type values
tfl.unidirectional_sequence_rnn (TFL::UnidirectionalSequenceRNNOp)
Unidirectional sequence rnn operator
Description:
A recurrent neural network specified by an RNN cell. This Op takes in input in a format {batch_size, seq_len, input_size} or {seq_len, batch_size, input_size} if it's time-majored.
It implements the following operation for each element in the sequence s = 1...sequence_length: outputs[s] = state = activation(RNNOp(inputs[s]))
where RNNOp is RNNOp TF Lite Op and the “activation” is the function passed as the “fused_activation_function” argument (if not “NONE”).
Operands:
-
input
: tensor of any type values -
input_to_input_weights
: tensor of any type values -
recurrent_to_input_weights
: tensor of any type values -
input_gate_bias
: tensor of any type values -
hidden_state
: stateful tensor
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
time_major | BoolAttr | bool attribute attribute |
fused_activation_function | StringAttr | fused activation enum attribute |
Results:
-
output
: tensor of any type values
tfl.unique (TFL::UniqueOp)
Unique Op.
Description:
This operation returns a tensor y
containing all of the unique elements of x
sorted in the same order that they occur in x
. This operation also returns a tensor idx
the same size as x
that contains the index of each value of x
in the unique output y
. In other words:
Operands:
-
input
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
idx_out_type | Attribute | derived attribute attribute |
Results:
-
output
: tensor of any type values -
idx
: tensor of any type values
tfl.unpack (TFL::UnpackOp)
Unpacks a tensor along a dimension into multiple tensors
Description:
Unpacks a given dimension of a rank- R
tensor into num
rank- (R-1)
tensors.
Unpacks num
tensors from value
by chipping it along the axis
dimension. For example, given a tensor of shape (A, B, C, D)
;
If axis == 0
then the i'th tensor in output
is the slice value[i, :, :, :]
and each tensor in output
will have shape (B, C, D)
. (Note that the dimension unpacked along is gone, unlike split
).
If axis == 1
then the i'th tensor in output
is the slice value[:, i, :, :]
and each tensor in output
will have shape (A, C, D)
. Etc.
This is the opposite of pack
.
Operands:
-
input
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
num | IntegerAttr | 32-bit integer attribute attribute |
axis | IntegerAttr | 32-bit integer attribute attribute |
Results:
-
outputs
: tensor of any type values
tfl.where (TFL::WhereOp)
Returns locations of nonzero / true values in a tensor.
Description:
This operation returns the coordinates of true elements in condition
. The coordinates are returned in a 2-D tensor where the first dimension (rows) represents the number of true elements, and the second dimension (columns) represents the coordinates of the true elements. Keep in mind, the shape of the output tensor can vary depending on how many true values there are in condition
. Indices are output in row-major order.
Operands:
-
input
: tensor of any type values
Attributes:
Results:
-
index
: tensor of any type values
tfl.while (TFL::WhileOp)
While loop
Description:
output = input; while (cond(output)) { output = body(output) }
While loop where all values are passes through arguments with implicit capture.
input: A list of input tensors whose types are T. output: A list of output tensors whose types are T. cond: A region takes 'input' and returns a boolean scalar tensor. body: A region that takes a list of tensors and returns another list of tensors. Both lists have the same types.
Operands:
-
input
: tensor of any type values
Attributes:
Attribute | MLIR Type | Description |
---|---|---|
is_stateless | BoolAttr | bool attribute attribute |
Results:
-
output
: tensor of any type values
tfl.yield (TFL::YieldOp)
Yield operation
Description:
The "yield" operation represents a return operation within the conditional and body of structured control flow (eg, while). The operation takes variable number of operands and produces no results. The operand number and types must match the signature of the region that contains the operation.
Operands:
-
operands
: any type
Attributes:
Results:
tfl.zeros_like (TFL::ZerosLikeOp)
ZerosLike operator
Description:
Returns a tensor of zeros with the same shape and type as the input tensor.
Operands:
-
input
: tensor of any type values
Attributes:
Results:
-
output
: tensor of any type values