|
14 | 14 | "The graph in model:\n",
|
15 | 15 | "node {\n",
|
16 | 16 | " input: \"X\"\n",
|
17 |
| - " input: \"Pads\"\n", |
| 17 | + " input: \"Pads\"\n", |
18 | 18 | " output: \"Y\"\n",
|
19 | 19 | " op_type: \"Pad\"\n",
|
20 | 20 | " attribute {\n",
|
|
25 | 25 | "}\n",
|
26 | 26 | "name: \"test-model\"\n",
|
27 | 27 | "initializer {\n",
|
28 |
| - " dims: 4\n", |
| 28 | + " dims: 4\n", |
29 | 29 | " data_type: 7\n",
|
30 | 30 | " int64_data: 0\n",
|
31 | 31 | " int64_data: 0\n",
|
32 | 32 | " int64_data: 1\n",
|
33 | 33 | " int64_data: 1\n",
|
34 | 34 | " name: \"Pads\"\n",
|
35 |
| - "}\n", |
| 35 | + "}\n", |
36 | 36 | "input {\n",
|
37 | 37 | " name: \"X\"\n",
|
38 | 38 | " type {\n",
|
|
61 | 61 | " }\n",
|
62 | 62 | " }\n",
|
63 | 63 | " }\n",
|
64 |
| - "}\n", |
| 64 | + "}\n", |
65 | 65 | "output {\n",
|
66 | 66 | " name: \"Y\"\n",
|
67 | 67 | " type {\n",
|
|
84 | 84 | }
|
85 | 85 | ],
|
86 | 86 | "source": [
|
87 |
| - "from __future__ import absolute_import\n", |
88 |
| - "from __future__ import division\n", |
89 |
| - "from __future__ import print_function\n", |
90 |
| - "from __future__ import unicode_literals\n", |
91 |
| - "\n", |
92 | 87 | "import onnx\n",
|
93 | 88 | "from onnx import helper\n",
|
94 | 89 | "from onnx import AttributeProto, TensorProto, GraphProto\n",
|
|
103 | 98 | "\n",
|
104 | 99 | "# Create second input (ValueInfoProto)\n",
|
105 | 100 | "Pads = helper.make_tensor_value_info('Pads', TensorProto.INT64, [4])\n",
|
106 |
| - "\n", |
| 101 | + "\n", |
107 | 102 | "# Create one output (ValueInfoProto)\n",
|
108 | 103 | "Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 4])\n",
|
109 | 104 | "\n",
|
|
137 | 132 | ],
|
138 | 133 | "metadata": {
|
139 | 134 | "kernelspec": {
|
140 |
| - "display_name": "Python 2", |
| 135 | + "display_name": "Python 3", |
141 | 136 | "language": "python",
|
142 |
| - "name": "python2" |
| 137 | + "name": "python3" |
143 | 138 | },
|
144 | 139 | "language_info": {
|
145 | 140 | "codemirror_mode": {
|
146 | 141 | "name": "ipython",
|
147 |
| - "version": 2 |
| 142 | + "version": 3 |
148 | 143 | },
|
149 | 144 | "file_extension": ".py",
|
150 | 145 | "mimetype": "text/x-python",
|
151 | 146 | "name": "python",
|
152 | 147 | "nbconvert_exporter": "python",
|
153 |
| - "pygments_lexer": "ipython2", |
154 |
| - "version": "2.7.5" |
| 148 | + "pygments_lexer": "ipython3", |
| 149 | + "version": "3.9.2" |
155 | 150 | }
|
156 | 151 | },
|
157 | 152 | "nbformat": 4,
|
|
0 commit comments