Skip to content

Commit

Permalink
Fix keras shape inference for lambda outputs (dmlc#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeep-krishnamurthy authored and piiswrong committed Sep 16, 2017
1 parent 928d1a5 commit a21823b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keras/layers/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,8 @@ def __init__(self, function, output_shape=None, arguments=None, **kwargs):

def get_output_shape_for(self, input_shape):
if self._output_shape is None:
# With TensorFlow, we can infer the output shape directly:
if K.backend() == 'tensorflow':
# With TensorFlow and MXNet, we can infer the output shape directly:
if K.backend() == 'tensorflow' or 'mxnet':
if isinstance(input_shape, list):
xs = [K.placeholder(shape=shape) for shape in input_shape]
x = self.call(xs)
Expand Down

0 comments on commit a21823b

Please sign in to comment.