TensorFlow Operator Boundaries
No. |
Python API |
C++ API |
Boundary |
---|---|---|---|
1 |
tf.nn.avg_pool |
AvgPool Type: Pooling |
[Arguments]
[Restrictions]
1) outputH == 1 && outputW == 1 && kernelH ≥ inputH && kernelW ≥ inputW 2) inputH * inputW ≤ 10000 [Returns] Tensor of the identical data type as value [Quantization tool supporting] Yes |
2 |
tf.math.reduce_mean |
Mean |
[Arguments] Same as tf.nn.avg_pool [Restrictions] The Mean operator adapts to the AvgPool operator. The restrictions are as follows:
[Returns] Tensor of the identical data type as value [Quantization tool supporting] Yes |
3 |
tf.nn.max_pool |
MaxPool |
Same as tf.nn.avg_pool |
4 |
tf.nn.conv2d |
Conv2D |
[Arguments]
[Restrictions]
[Returns] Tensor of the identical data type as value [Quantization tool supporting] Yes |
5 |
tf.concat |
Concat |
[Arguments]
[Restrictions]
The range of the input Tensor count is [1, 1000]. [Returns] Tensor, resulting from concatenation of the input Tensors [Quantization tool supporting] Yes |
6 |
tf.matmul |
MatMul |
[Arguments]
[Restrictions]
[Returns] Tensor of the identical data type as a and b [Quantization tool supporting] No |
7 |
tf.nn.fused_batch_norm |
FusedBatchNorm |
[Arguments]
[Restrictions] The shape of scale, bias, mean, and var must be (1, C, 1, 1), with the same C dimension as input. [Returns]
[Quantization tool supporting] No |
8 |
tf.abs |
Abs |
[Arguments]
[Restrictions] None [Returns] Returns the absolute value of x, Tensor or SparseTensor. The size and type are the same as those of x. [Quantization tool supporting] Yes |
9 |
tf.image.resize_nearest_neighbor |
ResizeNearestNeighbor |
[Arguments]
[Restrictions] None [Returns] Tensor of type float, with the identical shape as the input [Quantization tool supporting] No |
10 |
tf.image.resize_bilinear |
ResizeBilinear |
[Arguments]
[Restrictions] (outputH * outputW)/(inputH * inputW) > 1/7 [Returns] Tensor of type float, with the identical shape as the input [Quantization tool supporting] No |
11 |
tf.cast |
Cast |
[Inputs]
[Arguments]
[Restrictions] None [Returns] Tensor, SparseTensor, or IndexedSlices, same dtype and shape as the input [Quantization tool supporting] N/A |
12 |
tf.nn.depthwise_conv2d |
DepthwiseConv2dNative |
[Arguments]
[Restrictions] (W + 15)/16 * 16) * filter.W * 32 ≤ 32 * 1024, where, W is W of the operator input and filter.W is W of the filter. [Returns] 4D Tensor, with shape according to data_format. For example, for format NHWC, shape = [batch, out_height, out_width, in_channels * channel_multiplier] for the NHWC format [Quantization tool supporting] Yes |
13 |
tf.reshape |
Reshape |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as input [Quantization tool supporting] Yes |
14 |
tf.squeeze |
Squeeze |
[Arguments]
[Restrictions] None [Returns] Tensor, with the same data and type as input, but has one or more dimensions of size 1 removed. [Quantization tool supporting] Yes |
15 |
tf.expand_dims |
ExpandDims |
[Arguments]
[Restrictions] None [Returns] Tensor with the same data as input, but its shape has an additional dimension of size 1 added [Quantization tool supporting] Yes |
16 |
tf.greater |
Greater |
[Inputs] Two inputs
[Arguments] name: (optional) operation name [Restrictions]
[Returns] Constant tensor of type bool [Quantization tool supporting] N/A |
17 |
tf.nn.relu |
Relu |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as features [Quantization tool supporting] Yes |
18 |
tf.nn.relu6 |
Relu6 |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as features [Quantization tool supporting] Yes |
19 |
tf.nn.leaky_relu |
/ |
[Arguments]
[Restrictions] None [Returns] Activation value [Quantization tool supporting] Yes |
20 |
tf.exp |
exp |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
21 |
tf.nn.conv2d_transpose |
Conv2DBackpropInput |
[Inputs]
[Arguments]
[Restrictions]
1. a = ALIGN(filter_num, 16) * ALIGN(filter_c, 16) * filter_h * filter_w * 2 If ALIGN(filter_c, 16)%32 = 0, a = a/2 2. conv_input_width = (deconvolution input W – 1) * strideW + 1 3. b = (conv_input_width) * filter_h * ALIGN(filter_num, 16) * 2 * 2 4. a + b ≤ 1024 * 1024 [Returns] Tensor of the identical data type as value [Quantization tool supporting] Yes |
22 |
tf.sigmoid |
Sigmoid |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as value [Quantization tool supporting] Yes |
23 |
tf.add |
Add |
[Arguments]
[Restrictions] If the two inputs have inconsistent dimensions, broadcasting (that is, dimension padding) is performed. Broadcasting is supported only in the following scenarios: NHWC+ NHWC, NHWC+scalar NHWC + 1 1 1 1 NHWC + W, HWC + W, HW + W (W-based broadcasting) NCHW + NH1C, HWC + H1C, HW + H1 HWC + 1 WC (H-based broadcasting) Note: The input sequence of the two Tensors is not fixed. [Returns] Tensor of the identical data type as y [Quantization tool supporting] Yes |
24 |
tf.add_n |
- |
The tf.add_n operator internally invokes the Eltwise operator to add all input tensors by element-wise. For details about the input, constraints, and attributes, see the Eltwise operator in the Caffe Operator Boundaries. |
25 |
tf.multiply |
Multiply Type: Mul |
[Arguments]
[Restrictions] If the two inputs have inconsistent dimensions, broadcasting (that is, dimension padding) is performed. Broadcasting is supported only in the following scenarios: NHWC+ NHWC, NHWC+scalar NHWC + 1 1 1 1 NHWC + W, HWC + W, HW + W (W-based broadcasting) NCHW + NH1C, HWC + H1C, HW + H1 HWC + 1 WC (H-based broadcasting) Note: The input sequence of the two Tensors is not fixed. [Returns] Tensor [Quantization tool supporting] Yes |
26 |
tf.subtract |
Subtract Type: Sub |
[Arguments]
[Restrictions] If the two inputs have inconsistent dimensions, broadcasting (that is, dimension padding) is performed. Broadcasting is supported only in the following scenarios: NHWC+ NHWC, NHWC+scalar NHWC + 1 1 1 1 NHWC + W, HWC + W, HW + W (W-based broadcasting) NCHW + NH1C, HWC + H1C, HW + H1 HWC + 1 WC (H-based broadcasting) Note: The input sequence of the two Tensors is not fixed. [Returns] Tensor [Quantization tool supporting] Yes |
27 |
tf.nn.bias_add |
BiasAdd |
[Arguments]
[Restrictions]
[Returns] Tensor of the identical data type as value [Quantization tool supporting] Yes |
28 |
tf.nn.lrn |
Local response normalization (LRN) |
[Arguments]
[Restrictions]
[Returns] Tensor of the identical data type as input [Quantization tool supporting] Yes |
29 |
tf.nn.elu |
Elu |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as features [Quantization tool supporting] No |
30 |
tf.rsqrt |
Rsqrt |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as x [Quantization tool supporting] Yes |
31 |
tf.log |
Log |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
32 |
tf.tanh |
Tanh |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as x [Quantization tool supporting] Yes |
33 |
tf.slice |
Slice |
[Arguments]
[Restrictions] The number of tensor elements cannot exceed INT32_MAX. [Returns] Tensor of the identical data type as input_ [Quantization tool supporting] Yes |
34 |
tf.split |
Split |
[Arguments]
[Restrictions] None [Returns] List of Tensor objects resulting from splitting [Quantization tool supporting] Yes |
35 |
tf.nn.softplus |
Softplus |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as features [Quantization tool supporting] No |
36 |
tf.nn.softsign |
Softsign |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as features [Quantization tool supporting] No |
37 |
tf.pad |
Pad/MirrorPad/ PadV2 |
[Arguments]
[Restrictions] In CONSTANT mode: 0 ≤ PAD ≤ 128, 0 < W ≤ 3000 [Returns] Tensor of the identical data type as tensor [Quantization tool supporting] Yes |
38 |
tf.fake_quant_with_min_max_vars |
FakeQuantWithMinMaxVars |
[Arguments]
[Restrictions] –65504 ≤ min ≤ +65504, –65504 ≤ max ≤ +65504 [Returns] Tensor of type float32 [Quantization tool supporting] No |
39 |
tf.reduce_max |
Max |
[Arguments]
[Restrictions]
[Returns] Reduced Tensor of the identical data type as input_tensor [Quantization tool supporting] No |
40 |
tf.strided_slice |
StridedSlice |
[Arguments]
[Restrictions] strides ≠ 0 [Returns] Tensor of the identical data type as input_ [Quantization tool supporting] No |
41 |
tf.reverse |
Reverse |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as tensor [Quantization tool supporting] No |
42 |
tf.realdiv |
RealDiv |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as x [Quantization tool supporting] Yes |
43 |
tf.stack |
Stack |
[Arguments]
[Restrictions] None [Returns] Stacked Tensor of the identical data type as values Properties T, N, and axis are mandatory. [Quantization tool supporting] No |
44 |
tf.transpose |
Transpose |
[Arguments]
[Restrictions] None [Returns] Transposed Tensor [Quantization tool supporting] Yes |
45 |
tf.space_to_batch_nd |
SpaceToBatchND |
[Arguments]
[Restrictions]
[Returns] Tensor of the identical data type as input [Quantization tool supporting] No |
46 |
tf.batch_to_space_nd |
BatchToSpaceND |
[Arguments]
[Restrictions]
crop_start[i] + crop_end[i] < block_shape[i] * input_shape[i + 1] [Returns] Tensor of the identical data type as images [Quantization tool supporting] No |
47 |
tf.extract_image_patches |
ExtractImagePatches |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as images [Quantization tool supporting] No |
48 |
tf.floormod |
FloorMod |
[Arguments]
[Restrictions] Broadcasting is supported, so the shape of x and shape of y are compared. For a right-aligned dimension, if the values of xdim[i] and ydim[i] are not the same, one of them must be 1 or missing. [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
49 |
tf.nn.softmax |
Softmax |
[Arguments]
[Restrictions]
According to axis: When axis = 1: C ≤ ((256 * 1024/4) – 8 * 1024 – 256)/2 When axis = 0: N ≤ (56 * 1024 – 256)/2 When axis = 2: W = 1, 0 < H < (1024 * 1024/32) When axis = 3: 0 < W < (1024 * 1024/32)
[Returns] Tensor of the identical type and shape as logits [Quantization tool supporting] Yes |
50 |
tf.math.pow |
Power |
[Arguments]
[Restrictions] power! = 1 scale * x + shift > 0 [Returns] Tensor [Quantization tool supporting] Yes |
51 |
tf.nn.leaky_relu |
LeakyRelu |
[Arguments]
[Restrictions] None [Returns] Activation value [Quantization tool supporting] Yes |
52 |
tf.placeholder |
- |
[Arguments]
[Restrictions] None [Returns] Tensor [Quantization tool supporting] No |
53 |
tf.shape |
Shape |
[Arguments]
[Restrictions] None [Returns] Tensor of the data type specified by out_type [Quantization tool supporting] N/A |
54 |
tf.math.argmax |
ArgMax |
[Arguments]
[Restrictions] None [Returns] Tensor of the data type specified by out_type [Quantization tool supporting] No |
55 |
tf.gather |
Gather GatherV2 |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as params [Quantization tool supporting] No |
56 |
tf.gather_nd |
GatherNd |
[Arguments]
[Restrictions] indices: The last dimension of indices can be at most the rank of params. The elements in the last dimension of indices correspond to the coordinates along a dimension of params. Therefore, the coordinate rules must be met. The coordinates along the corresponding dimension of indices cannot exceed the dimension size. [Returns] Tensor of the identical data type as params [Quantization tool supporting] Yes |
57 |
tf.math.floordiv |
FloorDiv |
[Arguments]
[Restrictions] Broadcasting is supported, so the shape of x and shape of y are compared. For a right-aligned dimension, if the values of xdim[i] and ydim[i] are not the same, one of them must be 1 or missing. [Returns] Tensor, floor (x/y) [Quantization tool supporting] No |
58 |
tf.range |
Range |
[Arguments]
[Restrictions] None [Returns] 1D Tensor [Quantization tool supporting] No |
59 |
tf.tile |
Tile |
[Arguments]
[Restrictions] None [Returns] Tensor [Quantization tool supporting] Yes |
60 |
tf.size |
Size |
[Arguments]
[Restrictions] None [Returns] Tensor of the data type specified by out_type [Quantization tool supporting] No |
61 |
tf.fill |
Fill |
[Arguments]
[Restrictions] The following padding modes are supported: Constant, GivenTensor, Range, Diagonal, Gaussian, MSRA, Uniform, UniformInt, UniqueUniform, and XavierFill. When the Uniform, UniformInt, UniqueUniform, and xavier padding modes are used, the value range of the generated value is [min, max). [Returns] Tensor of the identical data type as value [Quantization tool supporting] No |
62 |
tf.concat |
Concat |
[Arguments]
[Restrictions] The number of dimensions of the input tensors must match, and all dimensions except axis must be equal. The range of the input Tensor count is [1, 1000]. [Returns] Tensor [Quantization tool supporting] Yes |
63 |
tf.reverse |
Reverse |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as tensor [Quantization tool supporting] No |
64 |
tf. reduce_sum |
sum |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as tensor [Quantization tool supporting] No |
65 |
tf. math.maximum |
Maximum |
[Arguments]
[Restrictions] Broadcasting is supported, so the shape of x and shape of y are compared. For a right-aligned dimension, if the values of xdim[i] and ydim[i] are not the same, one of them must be 1 or missing. [Returns] Tensor. Returns the max of x and y (x > y ? x: y). Identical data type as x [Quantization tool supporting] No |
66 |
tf. math.minimum |
Minimum |
[Arguments]
[Restrictions] Broadcasting is supported in the following two scenarios: NHWC+scaler, NHWC+NHWC [Returns] Tensor. Returns the min of x and y (x < y ? x : y). Identical data type as x [Quantization tool supporting] No |
67 |
tf.clip_by_value |
ClipByValue |
[Arguments]
[Restrictions] The minimum value must be less than or equal to the maximum value. [Returns] Clipped Tensor. The return value range is [clip_value_min, clip_value_max]. [Quantization tool supporting] No |
68 |
tf.math.logical_not |
LogicalNot |
[Arguments]
[Restrictions] None [Returns] Tensor of type bool [Quantization tool supporting] No |
69 |
tf.math.logical_and |
LogicalAnd |
[Arguments]
[Restrictions] Broadcasting is supported in the following dimension scenarios: NHWC and [1,1,1,1], [N,C,H,W], [N,1,H,W], [1,C,H,W], [N,C,1,1] [Returns] Tensor of type bool [Quantization tool supporting] No |
70 |
tf.equal |
Equal |
[Arguments]
[Restrictions] Broadcasting is supported, so the shape of x and shape of y are compared. For a right-aligned dimension, if the values of xdim[i] and ydim[i] are not the same, one of them must be 1 or missing. [Returns] Tensor of type bool [Quantization tool supporting] No |
71 |
tf.square |
Square |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
72 |
tf.image.crop_and_resize |
CropAndResize |
[Arguments]
[Restrictions] None [Returns] Tensor of type float32 [Quantization tool supporting] No |
73 |
tf.math.top_k |
TopKV2 |
[Arguments]
[Restrictions] k: constant [Returns]
[Quantization tool supporting]
|
74 |
tf.invert_permutation |
InvertPermutation |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
75 |
tf.multinomial |
Multinomial |
[Arguments]
[Restrictions] When seed is 0, the generated random is dynamic. The number of output data rows is the actual number of output data rows while the number of output data columns is num_samples. [Returns] Tensor of the data type specified by output_dtype [Quantization tool supporting] No |
76 |
tf.reverse_sequence |
ReverseSequence |
[Arguments]
[Restrictions]
Only one weight is required. [Returns] Tensor of the identical data type as input [Quantization tool supporting] No |
77 |
tf.math.reciprocal |
Reciprocal |
[Arguments]
[Restrictions] The input data cannot contain 0. [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
78 |
tf.nn.selu |
Selu |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as features [Quantization tool supporting] No |
79 |
tf.math.acosh |
Acosh |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
80 |
tf.math.asinh |
Asinh |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
81 |
tf.math.reduce_prod |
Prod |
[Arguments]
[Restrictions] None [Returns] Tensor and reduced Tensor [Quantization tool supporting] No |
82 |
tf.math.sqrt |
Sqrt |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
83 |
tf.math.reduce_all |
All |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as input_tensor [Quantization tool supporting] No |
84 |
tf.nn.l2_normalize |
L2Normalize |
[Arguments]
[Restrictions] H * W * 2 < 256* 1024/4 [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
85 |
tf.keras.backend.hard_sigmoid |
Hardsigmoid |
[Arguments] x: Tensor [Restrictions] None [Returns] Output Tensor If x < –2.5, 0 is returned. If x > 2.5, 1 is returned. If –2.5 ≤ x ≤ 2.5, 0.2 * x + 0.5 is returned. [Quantization tool supporting] No |
86 |
tf.keras.layers.ThresholdedReLU |
ThresholdedReLU |
[Arguments] theta: scalar ≥ 0 of type float32 [Restrictions] None [Returns] Tensor [Quantization tool supporting] No |
87 |
tf.math.acos |
Acos |
[Arguments]
[Restrictions] The input data range is (–1 ≤ x ≤ +1), and the output data range is (0 ≤ y ≤ π). [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
88 |
tf.math.atan |
Arctan |
[Arguments]
[Restrictions] The input data range is (–65504 ≤ x ≤ +65504), and the output data range is (–π/2 ≤ y ≤ +π/2). [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
89 |
tf.math.asin |
Asin |
[Arguments]
[Restrictions] The input data range is (–1 ≤ x ≤ +1), and the output data range is (–π/2 ≤ y ≤ +π/2). [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
90 |
tf.math.atanh |
Atanh |
[Arguments]
[Restrictions] Input data range: x is of range (–1, +1) [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
91 |
tf.math.tan |
Tan |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
92 |
tf.math.logical_or |
LogicalOr |
[Arguments]
[Restrictions] Broadcasting is supported, so the shape of x and shape of y are compared. For a right-aligned dimension, if the values of xdim[i] and ydim[i] are not the same, one of them must be 1 or missing. [Returns] Tensor of type bool [Quantization tool supporting] No |
93 |
tf.math.reduce_min |
ReduceMin |
[Arguments]
[Restrictions]
[Returns] Tensor of the identical data type as input_tensor [Quantization tool supporting] No |
94 |
tf.math.negative |
Neg |
[Arguments]
[Restrictions] The input data range is –65504 ≤ x ≤ +65504, and the output data range is –65504 ≤ y ≤ +65504. [Returns] Tensor. Returns –x. [Quantization tool supporting] No |
95 |
tf.math.greater_equal |
Greaterequal |
[Arguments]
[Restrictions] Input data range: –65504 ≤ x ≤ +65504 [Returns] Tensor of type bool [Quantization tool supporting] No |
96 |
tf.space_to_depth |
SpaceToDepth |
[Arguments]
[Restrictions] blockSize ≥ 1 and blockSize must be a divisor of both the input height and width. [Returns] Tensor of the identical data type as input [Quantization tool supporting] No |
97 |
tf.depth_to_space |
DepthToSpace |
[Arguments]
[Restrictions] blockSize must be greater than or equal to 1, and blockSize * blockSize must be exactly divided by C. [Returns] Tensor of the identical data type as input [Quantization tool supporting] No |
98 |
tf.math.round |
Round |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type and shape as x [Quantization tool supporting] No |
99 |
tf.math.rint |
Rint |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type and shape as x [Quantization tool supporting] No |
100 |
tf.math.less |
Less |
[Arguments]
[Restrictions] None [Returns] Tensor of type bool [Quantization tool supporting] No |
101 |
tf.math.sinh |
Sinh |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
102 |
tf.math.cosh |
Cosh |
[Arguments]
[Restrictions] None [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
103 |
tf.math.squared_difference |
Squared_difference |
[Arguments]
[Restrictions] Broadcasting is supported only in the following scenarios: One NCHW Tensor and one Tensor of the following format: dim{} = [1,1,1,1], [N,C,H,W], [N,1,H,W], [1,C,H,W], [N,C,1,1], [1,C,1,1], [1,1,H,W], or [N,1,1,1] [Returns] Tensor of the identical data type as x [Quantization tool supporting] No |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot