TensorFlow support broadcasting. I think it is no necessary to add the following assert in ElementwiseLayer:
assert str(self.outputs.get_shape()) == str(l.outputs.get_shape()), "Hint: the input shapes should be the same. %s != %s" % (self.outputs.get_shape() , str(l.outputs.get_shape()))