Skip to content

Commit aa0615e

Browse files
authored
Merge pull request #888 from onnx/gs/docgen
move some ops to generators.py, new version of supported ops doc
2 parents 994a2fb + fd58077 commit aa0615e

File tree

4 files changed

+208
-172
lines changed

4 files changed

+208
-172
lines changed

support_status.md

Lines changed: 184 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -2,156 +2,191 @@
22
### Domain: "" (default domain)
33
| Tensorflow Op | Convertible to ONNX Op Versions |
44
| ------------- | ------------------------------- |
5-
| Const | 1 ~ 10 |
6-
| ConstV2 | 1 ~ 10 |
7-
| RandomNormal | 1 ~ 10 |
8-
| RandomUniform | 1 ~ 10 |
9-
| RandomNormalLike | 1 ~ 10 |
10-
| RandomUniformLike | 1 ~ 10 |
11-
| ZerosLike | 1 ~ 10 |
12-
| LogicalNot | 1 ~ 10 |
13-
| LogicalOr | 1 ~ 10 |
14-
| LogicalAnd | 1 ~ 10 |
15-
| Equal | 1 ~ 10 |
16-
| NotEqual | 1 ~ 10 |
17-
| Greater | 1 ~ 10 |
18-
| Less | 1 ~ 10 |
19-
| Add | 1 ~ 10 |
20-
| AddV2 | 1 ~ 10 |
21-
| Div | 1 ~ 10 |
22-
| Mul | 1 ~ 10 |
23-
| Sub | 1 ~ 10 |
24-
| RealDiv | 1 ~ 10 |
25-
| TruncateDiv | 1 ~ 10 |
26-
| LeakyRelu | 1 ~ 10 |
27-
| LogSoftmax | 1 ~ 10 |
28-
| Softplus | 1 ~ 10 |
29-
| Softsign | 1 ~ 10 |
30-
| Abs | 1 ~ 10 |
31-
| Ceil | 1 ~ 10 |
32-
| Elu | 1 ~ 10 |
33-
| Exp | 1 ~ 10 |
34-
| Floor | 1 ~ 10 |
35-
| Log | 1 ~ 10 |
36-
| Neg | 1 ~ 10 |
37-
| Relu | 1 ~ 10 |
38-
| Sigmoid | 1 ~ 10 |
39-
| Sqrt | 1 ~ 10 |
40-
| Tanh | 1 ~ 10 |
41-
| Reciprocal | 1 ~ 10 |
42-
| Maximum | 1 ~ 10 |
43-
| Minimum | 1 ~ 10 |
44-
| Softmax | 1 ~ 10 |
45-
| Square | 1 ~ 10 |
46-
| Relu6 | 1 ~ 10 |
47-
| Rsqrt | 1 ~ 10 |
48-
| SquaredDifference | 1 ~ 10 |
49-
| Sign | 1 ~ 10 |
50-
| Pow | 1 ~ 10 |
51-
| LRN | 1 ~ 10 |
52-
| MatMul | 1 ~ 10 |
53-
| BatchMatMul | 1 ~ 10 |
54-
| BatchMatMulV2 | 1 ~ 10 |
55-
| Erf | 1 ~ 10 |
56-
| Selu | 1 ~ 10 |
57-
| CheckNumerics | 1 ~ 10 |
58-
| StopGradient | 1 ~ 10 |
59-
| Placeholder | 1 ~ 10 |
60-
| PlaceholderV2 | 1 ~ 10 |
61-
| PlaceholderWithDefault | 1 ~ 10 |
62-
| NoOp | 1 ~ 10 |
63-
| Size | 1 ~ 10 |
64-
| Flatten | 1 ~ 10 |
65-
| Dropout | 1 ~ 10 |
66-
| Identity | 1 ~ 10 |
67-
| Reshape | 1 ~ 10 |
68-
| Squeeze | 1 ~ 10 |
69-
| Transpose | 1 ~ 10 |
70-
| Concat | 1 ~ 10 |
71-
| ConcatV2 | 1 ~ 10 |
72-
| Slice | 1 ~ 10 |
73-
| Gather | 1 ~ 10 |
74-
| GatherV2 | 1 ~ 10 |
75-
| GatherNd | 1 ~ 10 |
76-
| Split | 1 ~ 10 |
77-
| SplitV | 1 ~ 10 |
78-
| ExpandDims | 1 ~ 10 |
79-
| StridedSlice | 1 ~ 10 |
80-
| Cast | 1 ~ 10 |
81-
| TopKV2 | 1 ~ 10 |
82-
| Tile | 1 ~ 10 |
83-
| Pack | 1 ~ 10 |
84-
| Unpack | 1 ~ 10 |
85-
| OneHot | 1 ~ 10 |
86-
| Shape | 1 ~ 10 |
87-
| BatchToSpaceND | 1 ~ 10 |
88-
| SpaceToBatchND | 1 ~ 10 |
89-
| Conv1D | 1 ~ 10 |
90-
| Conv2D | 1 ~ 10 |
91-
| Conv3D | 1 ~ 10 |
92-
| Conv2DBackpropInput | 1 ~ 10 |
93-
| DepthwiseConv2d | 1 ~ 10 |
94-
| DepthwiseConv2dNative | 1 ~ 10 |
95-
| MaxPool | 1 ~ 10 |
96-
| MaxPoolV2 | 1 ~ 10 |
97-
| AvgPool | 1 ~ 10 |
98-
| AvgPool3D | 1 ~ 10 |
99-
| BiasAdd | 1 ~ 10 |
100-
| BiasAddV1 | 1 ~ 10 |
101-
| Pad | 1 ~ 10 |
102-
| PadV2 | 1 ~ 10 |
103-
| MirrorPad | 1 ~ 10 |
104-
| SpaceToDepth | 1 ~ 10 |
105-
| DepthToSpace | 1 ~ 10 |
106-
| Prod | 1 ~ 10 |
107-
| Sum | 1 ~ 10 |
108-
| Mean | 1 ~ 10 |
109-
| Max | 1 ~ 10 |
110-
| Min | 1 ~ 10 |
111-
| ArgMax | 1 ~ 10 |
112-
| ArgMin | 1 ~ 10 |
113-
| LSTMBlockCell | 1 ~ 10 |
114-
| FloorDiv | 6 ~ 10 |
115-
| FusedBatchNorm | 6 ~ 10 |
116-
| FusedBatchNormV2 | 6 ~ 10 |
117-
| All | 6 ~ 10 |
118-
| Any | 6 ~ 10 |
119-
| AddN | 6 ~ 10 |
120-
| If | 7 ~ 10 |
121-
| Loop | 7 ~ 10 |
122-
| Scan | 7 ~ 10 |
123-
| Range | 7 ~ 10 |
124-
| Fill | 7 ~ 10 |
125-
| Multinomial | 7 ~ 10 |
126-
| LessEqual | 7 ~ 10 |
127-
| GreaterEqual | 7 ~ 10 |
128-
| Acos | 7 ~ 10 |
129-
| Asin | 7 ~ 10 |
130-
| Atan | 7 ~ 10 |
131-
| Cos | 7 ~ 10 |
132-
| Sin | 7 ~ 10 |
133-
| Tan | 7 ~ 10 |
134-
| FloorMod | 7 ~ 10 |
135-
| ResizeBilinear | 7 ~ 10 |
136-
| ResizeNearestNeighbor | 7 ~ 10 |
137-
| MatrixBandPart | 7 ~ 10 |
138-
| SoftmaxCrossEntropyWithLogits | 7 ~ 10 |
139-
| SparseSoftmaxCrossEntropyWithLogits | 7 ~ 10 |
140-
| Select | 8 ~ 10 |
141-
| ReverseSequence | 8 ~ 10 (Except 9) |
142-
| MaxPoolWithArgmax | 8 ~ 10 |
143-
| Where | 9 ~ 10 |
144-
| Acosh | 9 ~ 10 |
145-
| Asinh | 9 ~ 10 |
146-
| Atanh | 9 ~ 10 |
147-
| Cosh | 9 ~ 10 |
148-
| Sinh | 9 ~ 10 |
149-
| IsNan | 9 ~ 10 |
150-
| IsInf | 10 |
151-
| NonMaxSuppressionV2 | 10 |
152-
| NonMaxSuppressionV3 | 10 |
153-
| ReverseV2 | 10 |
5+
| Abs | 1 ~ 11 |
6+
| Acos | 7 ~ 11 |
7+
| Acosh | 9 ~ 11 |
8+
| Add | 1 ~ 11 |
9+
| AddN | 6 ~ 11 |
10+
| AddV2 | 1 ~ 11 |
11+
| All | 6 ~ 11 |
12+
| Any | 6 ~ 11 |
13+
| ArgMax | 1 ~ 11 |
14+
| ArgMin | 1 ~ 11 |
15+
| Asin | 7 ~ 11 |
16+
| Asinh | 9 ~ 11 |
17+
| Atan | 7 ~ 11 |
18+
| Atanh | 9 ~ 11 |
19+
| AvgPool | 1 ~ 11 |
20+
| AvgPool3D | 1 ~ 11 |
21+
| BatchMatMul | 1 ~ 11 |
22+
| BatchMatMulV2 | 1 ~ 11 |
23+
| BatchToSpaceND | 1 ~ 11 |
24+
| BiasAdd | 1 ~ 11 |
25+
| BiasAddV1 | 1 ~ 11 |
26+
| BroadcastTo | 8 ~ 11 |
27+
| Cast | 1 ~ 11 |
28+
| Ceil | 1 ~ 11 |
29+
| CheckNumerics | 1 ~ 11 |
30+
| ClipByValue | 8 ~ 11 |
31+
| Concat | 1 ~ 11 |
32+
| ConcatV2 | 1 ~ 11 |
33+
| Const | 1 ~ 11 |
34+
| ConstV2 | 1 ~ 11 |
35+
| Conv1D | 1 ~ 11 |
36+
| Conv2D | 1 ~ 11 |
37+
| Conv2DBackpropInput | 1 ~ 11 |
38+
| Conv3D | 1 ~ 11 |
39+
| Cos | 7 ~ 11 |
40+
| Cosh | 9 ~ 11 |
41+
| CropAndResize | 10 ~ 11 |
42+
| CudnnRNN | 10 ~ 11 |
43+
| Cumsum | 11 |
44+
| DepthToSpace | 1 ~ 11 |
45+
| DepthwiseConv2d | 1 ~ 11 |
46+
| DepthwiseConv2dNative | 1 ~ 11 |
47+
| Div | 1 ~ 11 |
48+
| Dropout | 1 ~ 11 |
49+
| Elu | 1 ~ 11 |
50+
| Equal | 1 ~ 11 |
51+
| Erf | 1 ~ 11 |
52+
| Exp | 1 ~ 11 |
53+
| ExpandDims | 1 ~ 11 |
54+
| FIFOQueueV2 | 8 ~ 11 |
55+
| Fill | 7 ~ 11 |
56+
| Flatten | 1 ~ 11 |
57+
| Floor | 1 ~ 11 |
58+
| FloorDiv | 6 ~ 11 |
59+
| FloorMod | 7 ~ 11 |
60+
| FusedBatchNorm | 6 ~ 11 |
61+
| FusedBatchNormV2 | 6 ~ 11 |
62+
| FusedBatchNormV3 | 6 ~ 11 |
63+
| Gather | 1 ~ 11 |
64+
| GatherNd | 1 ~ 11 |
65+
| GatherV2 | 1 ~ 11 |
66+
| Greater | 1 ~ 11 |
67+
| GreaterEqual | 7 ~ 11 |
68+
| HashTableV2 | 8 ~ 11 |
69+
| Identity | 1 ~ 11 |
70+
| IdentityN | 1 ~ 11 |
71+
| If | 1 ~ 11 |
72+
| IsInf | 10 ~ 11 |
73+
| IsNan | 9 ~ 11 |
74+
| IteratorGetNext | 8 ~ 11 |
75+
| IteratorV2 | 8 ~ 11 |
76+
| LRN | 1 ~ 11 |
77+
| LSTMBlockCell | 1 ~ 11 |
78+
| LeakyRelu | 1 ~ 11 |
79+
| LeftShift | 11 |
80+
| Less | 1 ~ 11 |
81+
| LessEqual | 7 ~ 11 |
82+
| Log | 1 ~ 11 |
83+
| LogSoftmax | 1 ~ 11 |
84+
| LogicalAnd | 1 ~ 11 |
85+
| LogicalNot | 1 ~ 11 |
86+
| LogicalOr | 1 ~ 11 |
87+
| LookupTableFindV2 | 8 ~ 11 |
88+
| Loop | 7 ~ 11 |
89+
| MatMul | 1 ~ 11 |
90+
| MatrixBandPart | 7 ~ 11 |
91+
| MatrixDeterminant | 11 |
92+
| MatrixDiagPart | 11 |
93+
| Max | 1 ~ 11 |
94+
| MaxPool | 1 ~ 11 |
95+
| MaxPoolV2 | 1 ~ 11 |
96+
| MaxPoolWithArgmax | 8 ~ 11 |
97+
| Maximum | 1 ~ 11 |
98+
| Mean | 1 ~ 11 |
99+
| Min | 1 ~ 11 |
100+
| Minimum | 1 ~ 11 |
101+
| MirrorPad | 1 ~ 11 |
102+
| Mul | 1 ~ 11 |
103+
| Multinomial | 7 ~ 11 |
104+
| Neg | 1 ~ 11 |
105+
| NoOp | 1 ~ 11 |
106+
| NonMaxSuppressionV2 | 10 ~ 11 |
107+
| NonMaxSuppressionV3 | 10 ~ 11 |
108+
| NonMaxSuppressionV4 | 10 ~ 11 |
109+
| NonMaxSuppressionV5 | 10 ~ 11 |
110+
| NotEqual | 1 ~ 11 |
111+
| OneHot | 1 ~ 11 |
112+
| Pack | 1 ~ 11 |
113+
| Pad | 1 ~ 11 |
114+
| PadV2 | 1 ~ 11 |
115+
| Placeholder | 1 ~ 11 |
116+
| PlaceholderV2 | 1 ~ 11 |
117+
| PlaceholderWithDefault | 1 ~ 11 |
118+
| Pow | 1 ~ 11 |
119+
| Prod | 1 ~ 11 |
120+
| QueueDequeueV2 | 8 ~ 11 |
121+
| RandomNormal | 1 ~ 11 |
122+
| RandomNormalLike | 1 ~ 11 |
123+
| RandomUniform | 1 ~ 11 |
124+
| RandomUniformLike | 1 ~ 11 |
125+
| Range | 7 ~ 11 |
126+
| RealDiv | 1 ~ 11 |
127+
| Reciprocal | 1 ~ 11 |
128+
| Relu | 1 ~ 11 |
129+
| Relu6 | 1 ~ 11 |
130+
| Reshape | 1 ~ 11 |
131+
| ResizeBilinear | 7 ~ 11 |
132+
| ResizeNearestNeighbor | 7 ~ 11 |
133+
| ReverseSequence | 8 ~ 11 (Except 9) |
134+
| ReverseV2 | 10 ~ 11 |
135+
| RightShift | 11 |
136+
| Round | 11 |
137+
| Rsqrt | 1 ~ 11 |
138+
| Scan | 7 ~ 11 |
139+
| ScatterNd | 11 |
140+
| Select | 7 ~ 11 |
141+
| SelectV2 | 7 ~ 11 |
142+
| Selu | 1 ~ 11 |
143+
| Shape | 1 ~ 11 |
144+
| Sigmoid | 1 ~ 11 |
145+
| Sign | 1 ~ 11 |
146+
| Sin | 7 ~ 11 |
147+
| Sinh | 9 ~ 11 |
148+
| Size | 1 ~ 11 |
149+
| Slice | 1 ~ 11 |
150+
| Softmax | 1 ~ 11 |
151+
| SoftmaxCrossEntropyWithLogits | 7 ~ 11 |
152+
| Softplus | 1 ~ 11 |
153+
| Softsign | 1 ~ 11 |
154+
| SpaceToBatchND | 1 ~ 11 |
155+
| SpaceToDepth | 1 ~ 11 |
156+
| SparseSoftmaxCrossEntropyWithLogits | 7 ~ 11 |
157+
| Split | 1 ~ 11 |
158+
| SplitV | 1 ~ 11 |
159+
| Sqrt | 1 ~ 11 |
160+
| Square | 1 ~ 11 |
161+
| SquaredDifference | 1 ~ 11 |
162+
| Squeeze | 1 ~ 11 |
163+
| StatelessIf | 1 ~ 11 |
164+
| StatelessWhile | 7 ~ 11 |
165+
| StopGradient | 1 ~ 11 |
166+
| StridedSlice | 1 ~ 11 |
167+
| Sub | 1 ~ 11 |
168+
| Sum | 1 ~ 11 |
169+
| Tan | 7 ~ 11 |
170+
| Tanh | 1 ~ 11 |
171+
| TensorListFromTensor | 7 ~ 11 |
172+
| TensorListGetItem | 7 ~ 11 |
173+
| TensorListLength | 7 ~ 11 |
174+
| TensorListReserve | 7 ~ 11 |
175+
| TensorListResize | 7 ~ 11 |
176+
| TensorListSetItem | 7 ~ 11 |
177+
| TensorListStack | 7 ~ 11 |
178+
| Tile | 1 ~ 11 |
179+
| TopKV2 | 1 ~ 11 |
180+
| Transpose | 1 ~ 11 |
181+
| TruncateDiv | 1 ~ 11 |
182+
| Unique | 11 |
183+
| Unpack | 1 ~ 11 |
184+
| Where | 9 ~ 11 |
185+
| While | 7 ~ 11 |
186+
| ZerosLike | 1 ~ 11 |
154187
### Domain: "com.microsoft"
155188
| Tensorflow Op | Convertible to ONNX Op Versions |
156189
| ------------- | ------------------------------- |
190+
| Conv2DBackpropInput | 1 |
191+
| CropAndResize | 1 |
157192
| Range | 1 |

tf2onnx/onnx_opset/controlflow.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -393,27 +393,6 @@ def version_9(cls, ctx, node, **kwargs):
393393
ctx.copy_dtype(node.output[0], transpose_node.output[0])
394394

395395

396-
@tf_op("IteratorV2", "FIFOQueueV2")
397-
class Iterator:
398-
@classmethod
399-
def version_8(cls, ctx, node, **kwargs):
400-
ctx.remove_node(node.name)
401-
402-
403-
@tf_op("IteratorGetNext", "QueueDequeueV2")
404-
class IteratorGetNext:
405-
@classmethod
406-
def version_8(cls, ctx, node, **kwargs):
407-
output_names = node.output
408-
type_0 = ctx.get_dtype(output_names[0])
409-
type_1 = ctx.get_dtype(output_names[1])
410-
shape_0 = ctx.get_shape(output_names[0])
411-
shape_1 = ctx.get_shape(output_names[1])
412-
ctx.remove_node(node.name)
413-
ctx.add_graph_input(output_names[0], type_0, shape_0)
414-
ctx.add_graph_input(output_names[1], type_1, shape_1)
415-
416-
417396
@tf_op(["StatelessIf"])
418397
class StatelessIfOp:
419398
@classmethod

tf2onnx/onnx_opset/generator.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,24 @@ def version_1(cls, ctx, node, **kwargs):
173173
attr={'to': dtypes[0]},
174174
name=node.name, outputs=node.output,
175175
shapes=shapes, dtypes=dtypes)
176+
177+
178+
@tf_op(["IteratorV2", "FIFOQueueV2"])
179+
class Iterator:
180+
@classmethod
181+
def version_8(cls, ctx, node, **kwargs):
182+
ctx.remove_node(node.name)
183+
184+
185+
@tf_op(["IteratorGetNext", "QueueDequeueV2"])
186+
class IteratorGetNext:
187+
@classmethod
188+
def version_8(cls, ctx, node, **kwargs):
189+
output_names = node.output
190+
type_0 = ctx.get_dtype(output_names[0])
191+
type_1 = ctx.get_dtype(output_names[1])
192+
shape_0 = ctx.get_shape(output_names[0])
193+
shape_1 = ctx.get_shape(output_names[1])
194+
ctx.remove_node(node.name)
195+
ctx.add_graph_input(output_names[0], type_0, shape_0)
196+
ctx.add_graph_input(output_names[1], type_1, shape_1)

0 commit comments

Comments
 (0)