Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
theano_backend.py pep8 & padding fix
  • Loading branch information
ahundt authored Feb 6, 2018
commit 104f209a3ab41503182502b54d2fc488e0e909b0
6 changes: 4 additions & 2 deletions keras/backend/theano_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,8 +904,10 @@ def resize_images(x, height_factor, width_factor, data_format, interpolation='ne
output = repeat_elements(x, height_factor, axis=axis_1)
output = repeat_elements(output, width_factor, axis=axis_2)
elif interpolation == 'bilinear':
ratio = height_factor/width_factor
output = theano.tensor.nnet.abstract_conv.bilinear_upsampling(x, ratio=ratio)
ratio = height_factor / width_factor
th_padding = _preprocess_padding('same')
output = theano.tensor.nnet.abstract_conv.bilinear_upsampling(
x, ratio=ratio, border_mode=th_padding)
if hasattr(x, '_keras_shape'):
output._keras_shape = list(x._keras_shape)
repeat_dim_1 = x._keras_shape[axis_1]
Expand Down