onnx2tf 1.27.1__py3-none-any.whl → 1.27.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
onnx2tf/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  from onnx2tf.onnx2tf import convert, main
2
2
 
3
- __version__ = '1.27.1'
3
+ __version__ = '1.27.2'
onnx2tf/ops/Split.py CHANGED
@@ -158,15 +158,56 @@ def make_node(
158
158
  if idx == axis:
159
159
  end_.append(split_idx + 1)
160
160
  elif input_tensor_shape[idx] is None:
161
- end_.append(-1)
161
+ end_.append(0)
162
162
  else:
163
163
  end_.append(input_tensor_shape[idx])
164
164
 
165
+ begin_mask_ = np.sum([2**idx if idx != axis else 0 for idx in range(input_tensor_rank)])
166
+ end_mask_ = np.sum([2**idx if idx != axis else 0 for idx in range(input_tensor_rank)])
167
+
165
168
  splited_tensors.append(
166
169
  tf.strided_slice(
167
170
  input_=input_tensor,
168
171
  begin=begin_,
169
172
  end=end_,
173
+ begin_mask=begin_mask_,
174
+ end_mask=end_mask_,
175
+ )
176
+ )
177
+ elif isinstance(split, np.ndarray) \
178
+ and len(list(split)) > 1 \
179
+ and np.prod(split) != 1 \
180
+ and np.all(split == split[0]) \
181
+ and isinstance(input_tensor_shape[axis], int) \
182
+ and input_tensor_shape[axis] == np.sum(split):
183
+ # strided_slice - Slice everything in same size
184
+ # Suppression of FlexSplitV generation
185
+ # https://github.com/PINTO0309/onnx2tf/issues/751
186
+ splited_tensors = []
187
+ split_size = split[0]
188
+ for split_idx in range(len(list(split))):
189
+ begin_ = [
190
+ split_size * split_idx if idx == axis else 0 for idx in range(input_tensor_rank)
191
+ ]
192
+ end_ = []
193
+ for idx in range(input_tensor_rank):
194
+ if idx == axis:
195
+ end_.append(split_size * split_idx + split_size)
196
+ elif input_tensor_shape[idx] is None:
197
+ end_.append(0)
198
+ else:
199
+ end_.append(input_tensor_shape[idx])
200
+
201
+ begin_mask_ = np.sum([2**idx if idx != axis else 0 for idx in range(input_tensor_rank)])
202
+ end_mask_ = np.sum([2**idx if idx != axis else 0 for idx in range(input_tensor_rank)])
203
+
204
+ splited_tensors.append(
205
+ tf.strided_slice(
206
+ input_=input_tensor,
207
+ begin=begin_,
208
+ end=end_,
209
+ begin_mask=begin_mask_,
210
+ end_mask=end_mask_,
170
211
  )
171
212
  )
172
213
  elif isinstance(split, np.ndarray) \
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: onnx2tf
3
- Version: 1.27.1
3
+ Version: 1.27.2
4
4
  Summary: Self-Created Tools to convert ONNX files (NCHW) to TensorFlow/TFLite/Keras format (NHWC). The purpose of this tool is to solve the massive Transpose extrapolation problem in onnx-tensorflow (onnx-tf).
5
5
  Home-page: https://github.com/PINTO0309/onnx2tf
6
6
  Author: Katsuya Hyodo
@@ -334,7 +334,7 @@ Video speed is adjusted approximately 50 times slower than actual speed.
334
334
  docker run --rm -it \
335
335
  -v `pwd`:/workdir \
336
336
  -w /workdir \
337
- ghcr.io/pinto0309/onnx2tf:1.27.1
337
+ ghcr.io/pinto0309/onnx2tf:1.27.2
338
338
 
339
339
  or
340
340
 
@@ -342,7 +342,7 @@ Video speed is adjusted approximately 50 times slower than actual speed.
342
342
  docker run --rm -it \
343
343
  -v `pwd`:/workdir \
344
344
  -w /workdir \
345
- docker.io/pinto0309/onnx2tf:1.27.1
345
+ docker.io/pinto0309/onnx2tf:1.27.2
346
346
 
347
347
  or
348
348
 
@@ -1,4 +1,4 @@
1
- onnx2tf/__init__.py,sha256=1DKX0NLn80YH-Q7CqMU_p0krBqmhasp8q5rJQdssxTw,66
1
+ onnx2tf/__init__.py,sha256=hu7TZkPbwUCwf8zZcrp1NGR2aMUiIbLW_oqR1se7KzI,66
2
2
  onnx2tf/__main__.py,sha256=2RSCQ7d4lc6CwD-rlGn9UicPFg-P5du7ZD_yh-kuBEU,57
3
3
  onnx2tf/onnx2tf.py,sha256=IEnfIs3Dy8Y5F3iJ4HY7bWkn3QuB6lq_gHa1q5E3tMI,124745
4
4
  onnx2tf/ops/Abs.py,sha256=V7btmCG_ZvK_qJovUsguq0ZMJ349mhNQ4FHSgzP_Yuo,4029
@@ -162,7 +162,7 @@ onnx2tf/ops/Softmax.py,sha256=CEnHcSm25v1QC4QVDg4fz1NooYY1v-Uq4GORd8dnnr8,14773
162
162
  onnx2tf/ops/Softplus.py,sha256=R44YMo8G2Ig15jBO6T2VOI6RhpUmjD70qvSCXFylU-Q,3605
163
163
  onnx2tf/ops/Softsign.py,sha256=2ZdKH3KVHZXDzyO7S8f-O_aqRugurbRxd1i2g_fwCos,3600
164
164
  onnx2tf/ops/SpaceToDepth.py,sha256=rWtPQNm2rErYs20gQyz-tFYsImAIUBGtdvfMVkJg5bo,2809
165
- onnx2tf/ops/Split.py,sha256=ueBG52Z_wWD2xZLXgCPB11VbYz6pQDvhATqylomEMY8,8946
165
+ onnx2tf/ops/Split.py,sha256=ukm7QZmSwYwUwGLbVGsOiCEB3YfrFMl0cozn1kwgCv0,10728
166
166
  onnx2tf/ops/SplitToSequence.py,sha256=BS_JEd7DC7vuPfs5oRRW774mtlK--kqf9DJUalv-Agk,5062
167
167
  onnx2tf/ops/Sqrt.py,sha256=-xE8Tk_6unSR56k9g3R46lML4Nht5kQwqJT0JYkn5ko,3585
168
168
  onnx2tf/ops/Squeeze.py,sha256=FLIt2qjWh1IJyti1c4YHuepH2Fkxt40rnEKszzmwsnE,7980
@@ -188,10 +188,10 @@ onnx2tf/utils/__init__.py,sha256=E9FM9He68VIASDnYp-OrxvHFVn55GzWqw2OEkCqn1zg,27
188
188
  onnx2tf/utils/common_functions.py,sha256=HTDca3DGXB3xvc1S50RNscgB57TCiq4yC5Nrafs6ka4,241430
189
189
  onnx2tf/utils/enums.py,sha256=7c5TqetqB07VjyHoxJHfLgtqBqk9ZRyUF33fPOJR1IM,1649
190
190
  onnx2tf/utils/logging.py,sha256=yUCmPuJ_XiUItM3sZMcaMO24JErkQy7zZwVTYWAuiKg,1982
191
- onnx2tf-1.27.1.dist-info/licenses/LICENSE,sha256=5v_Kxihy8i6mzHVl349ikSREaIdsl9YeUnX1KBDLD2w,1070
192
- onnx2tf-1.27.1.dist-info/licenses/LICENSE_onnx-tensorflow,sha256=gK4GtS9S5YcyINu6uuNNWdo-kBClyEM4MFLFGiNTeRM,11231
193
- onnx2tf-1.27.1.dist-info/METADATA,sha256=_cqkJJkplUxrDL2K4Kk4lsXZ5BLefqYuNLh7hvVA8Nc,147712
194
- onnx2tf-1.27.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
195
- onnx2tf-1.27.1.dist-info/entry_points.txt,sha256=gDPK8ToCFPKMvm8jr9xrGOkXtORJJVh4736fBEKO5k0,41
196
- onnx2tf-1.27.1.dist-info/top_level.txt,sha256=WgfPiEy3f6vZ_FOpAIEA2CF3TCx1eYrhGw93Ih6b9Fw,8
197
- onnx2tf-1.27.1.dist-info/RECORD,,
191
+ onnx2tf-1.27.2.dist-info/licenses/LICENSE,sha256=5v_Kxihy8i6mzHVl349ikSREaIdsl9YeUnX1KBDLD2w,1070
192
+ onnx2tf-1.27.2.dist-info/licenses/LICENSE_onnx-tensorflow,sha256=gK4GtS9S5YcyINu6uuNNWdo-kBClyEM4MFLFGiNTeRM,11231
193
+ onnx2tf-1.27.2.dist-info/METADATA,sha256=Vhy11gd-Dvr86ENsHvxyHUhVQGHzwEY6PHvY8KYmVqM,147712
194
+ onnx2tf-1.27.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
195
+ onnx2tf-1.27.2.dist-info/entry_points.txt,sha256=gDPK8ToCFPKMvm8jr9xrGOkXtORJJVh4736fBEKO5k0,41
196
+ onnx2tf-1.27.2.dist-info/top_level.txt,sha256=WgfPiEy3f6vZ_FOpAIEA2CF3TCx1eYrhGw93Ih6b9Fw,8
197
+ onnx2tf-1.27.2.dist-info/RECORD,,