title: Custom layer needs changing tf.keras.input empty tensor into numpy ndarray - 'Tensor' object has no attribute 'numpy' error
body: <p>I've written a <code>tf.keras</code> custom layer in which I used some functions that work only with <code>numpy</code> arrays, so when I try to use my layer in a model with tf.keras.Input, the functions raise an error: <code>input data must be a numpy ndarray.</code></p>
  
  <p><code>tf.keras.backend.eval(x)</code> and <code>x.numpy()</code> both results in error: <code>'Tensor' object has no attribute 'numpy'</code> , even though eager execution is enabled.</p>
  
  <p>using <code>sess = tf.compat.v1.Session()</code> and <code>sess.run(x)</code> gives: The Session graph is empty. Add operations to the graph before calling <code>run()</code></p>
  
  <p>Here's a sample model I'm testing with:</p>
  
  <pre><code>inputs = keras.Input(shape=(48,48,1))
  x = keras.layers.Conv2D(64, (3,3), padding='same', activation='relu')(inputs)
  
  # y = tf.keras.backend.eval(x)
  
  # init_op = tf.compat.v1.global_variables_initializer()
  # with tf.compat.v1.Session() as sess:
  #    sess.run(init_op)
  #    y = sess.run(x)
  
  # y = x.numpy()
  
  z = Mylayer.My_custom_layer()(y)
  outputs = z
  model = keras.Model(inputs=inputs, outputs=outputs)
  </code></pre>
  
  <p>The commented lines are what I've tested.</p>
  
  <p>Is there anyway that I can convert this tensor input to <code>numpy</code> array before entering my custom layer?</p>