Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Commit 62a200f

Browse files
committed
Improve performance of the sub-pixel reshuffle layer.
1 parent 1ded2ae commit 62a200f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

enhance.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,10 @@ def up(d): return self.upscale * d if d else d
267267
def get_output_for(self, input, deterministic=False, **kwargs):
268268
out, r = T.zeros(self.get_output_shape_for(input.shape)), self.upscale
269269
for y, x in itertools.product(range(r), repeat=2):
270-
out=T.inc_subtensor(out[:,:,y::r,x::r], input[:,r*y+x::r*r,:,:])
270+
out = T.set_subtensor(out[:,:,y::r,x::r], input[:,r*y+x::r*r,:,:])
271+
return out
272+
273+
271274
return out
272275

273276

0 commit comments

Comments
 (0)