Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
Fixed a remnant hardcoding from 2D init
Browse files Browse the repository at this point in the history
  • Loading branch information
danieltudosiu committed Oct 24, 2019
1 parent 72437a2 commit abd8e70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions niftynet/layer/subpixel.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ def __call__(self, shape, dtype, partition_info=None):
return self.initializer(shape)

# Initializing W0 (enough kernels for one output channel)
new_shape = shape[:-1] + [shape[-1] // (self.upsample_factor ** 2)]
new_shape = shape[:-1] + [shape[-1] // (self.upsample_factor ** (len(shape)-2))]
x = self.initializer(new_shape, dtype, partition_info)

# Repeat the elements along the output dimension
x = tf.keras.backend.repeat_elements(
x=x,
rep=self.upsample_factor ** 2,
rep=self.upsample_factor ** len(shape)-2,
axis=-1
)

Expand Down

0 comments on commit abd8e70

Please sign in to comment.