Skip to content

Commit 5b8c1b4

Browse files
authored
Merge pull request #668 from PINTO0309/fix_dynamic_depth_to_space
Support for `DepthToSpace` transformation of dynamic tensors with multiple undefined dimensions
2 parents f2a8d31 + cd43351 commit 5b8c1b4

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,15 @@ Video speed is adjusted approximately 50 times slower than actual speed.
297297
docker run --rm -it \
298298
-v `pwd`:/workdir \
299299
-w /workdir \
300-
ghcr.io/pinto0309/onnx2tf:1.25.1
300+
ghcr.io/pinto0309/onnx2tf:1.25.2
301301

302302
or
303303

304304
# Authentication is not required for pulls from Docker Hub.
305305
docker run --rm -it \
306306
-v `pwd`:/workdir \
307307
-w /workdir \
308-
docker.io/pinto0309/onnx2tf:1.25.1
308+
docker.io/pinto0309/onnx2tf:1.25.2
309309

310310
or
311311

onnx2tf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from onnx2tf.onnx2tf import convert, main
22

3-
__version__ = '1.25.1'
3+
__version__ = '1.25.2'

onnx2tf/ops/DepthToSpace.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ def make_node(
9696
elif mode == "CRD":
9797
batch, channel = input_tensor_shape[0], input_tensor_shape[-1]
9898
height, width = input_tensor_shape[1], input_tensor_shape[2]
99+
if batch is None:
100+
batch = tf.shape(input_tensor)[0]
101+
if channel is None:
102+
channel = tf.shape(input_tensor)[-1]
103+
if height is None:
104+
height = tf.shape(input_tensor)[1]
105+
if width is None:
106+
width = tf.shape(input_tensor)[2]
99107
csize = channel // (blocksize**2)
100108

101109
reshape_node = tf.reshape(

0 commit comments

Comments
 (0)