

def get_output_shape_for(self, input_shape):
    if (self._output_shape is None):
        if (K._BACKEND == 'tensorflow'):
            if (type(input_shape) is list):
                xs = [K.placeholder(shape=shape) for shape in input_shape]
                x = self.call(xs)
            else:
                x = K.placeholder(shape=input_shape)
                x = self.call(x)
            if (type(x) is list):
                return [K.int_shape(x_elem) for x_elem in x]
            else:
                return K.int_shape(x)
        return input_shape
    elif (type(self._output_shape) in {tuple, list}):
        nb_samples = (input_shape[0] if input_shape else None)
        return ((nb_samples,) + tuple(self._output_shape))
    else:
        shape = self._output_shape(input_shape)
        if (type(shape) not in {list, tuple}):
            raise Exception('output_shape function must return a tuple')
        return tuple(shape)

dataset/ETHPy150Open fchollet/keras/keras/layers/core.py Lambda.get_output_shape_for/original