Skip to content

Commit

Permalink
Merge pull request #72 from deel-ai/fix/InvertibleUpsampling_TF2.12
Browse files Browse the repository at this point in the history
Fix x.shape in InvertibleUpSampling __call__() returning (None, None)
  • Loading branch information
thib-s authored May 25, 2023
2 parents 3ec7850 + dc000e8 commit 796cbd1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions deel/lip/layers/pooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,13 +475,10 @@ def call(self, inputs, **kwargs):
# convert to channels_first
inputs = tf.transpose(inputs, [0, 2, 3, 1])
# from shape (bs, w, h, c*pw*ph) to (bs, w, h, pw, ph, c)
bs, w, h = inputs.shape[:-1]
(
pw,
ph,
) = self.pool_size
c = inputs.shape[-1] // (pw * ph)
print(c)
input_shape = tf.shape(inputs)
w, h, c_in = input_shape[1], input_shape[2], input_shape[3]
pw, ph = self.pool_size
c = c_in // (pw * ph)
inputs = tf.reshape(inputs, (-1, w, h, pw, ph, c))
inputs = tf.transpose(
tf.reshape(
Expand Down

0 comments on commit 796cbd1

Please sign in to comment.