title: Keras: Multiply with constant
body: <p>Is it possible <code>x*a</code> from input <code>size(None, None, 3)</code> in Keras? For example, the input <code>x</code> and <code>constant a: x(batch,None,None,1024)*a(batch,1)</code>.</p>
  
  <p>I use input <code>size (64, 64, 3)</code> in train but test data should use variable input sizes. The test size can not be adjusted for fair image processing.</p>
  
  <p>I try Lambda <code>function(lambda x : x * a)(seq)</code>. Then, I got no problem in code. And then, I start model.fit function, I got error:      </p>
  
  <pre><code>-------------&gt;&gt;tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [7,4,4,1024] vs. [7,1]. 
  </code></pre>
  
  <p>.</p>
  
  <pre><code>conv5 = Conv2D(1024, 3, activation = 'relu', padding = 'same', kernel_initializer = 'he_normal')(pool4)
  conv5 = Conv2D(1024, 3, activation = 'relu', padding = 'same', kernel_initializer = 'he_normal')(conv5)
  
  conv_c = Conv2D(num_classes, 1, activation='softmax')(conv5)
  conv_c1 = GlobalAveragePooling2D(name="class_output")(conv_c)
  
  conv_c1_1 = conv_c1[:, 0:1]
  conv_c1_2 = conv_c1[:, 1:2]
  conv_c1_3 = conv_c1[:, 2:3]
  
  conv5_b = Lambda(lambda x: x * conv_c1_1)(conv5) #conv5:Tensor(shape=(?, 4, 4, 1024))
  conv5_h = Lambda(lambda x: x * conv_c1_2)(conv5) #conv_c1_1: Tensor(shape=(?, 1))
  conv5_r = Lambda(lambda x: x * conv_c1_3)(conv5)
  </code></pre>