from keras.layers import Input, Embedding first_input = Input(shape = (your_shape_tuple) ) second_input = Input(shape = (your_shape_tuple) ) ... embedding_layer = Embedding(embedding_size) first_input_encoded = embedding_layer(first_input) second_input_encoded = embedding_layer(second_input) ... Rest of the model....
Emnedding_layer will have common weights. You can do this as layer lists if you have a lot of input.
If you want to convert the input tensor, the way to do this is:
from keras.layers import Input, Embedding
Is this what you were looking for?
source share