Bagaimana saya bisa mendapatkan output dari setiap lapisan dalam tensorflow 2

from tensorflow.python.keras import backend as K

model = build_model() 
# lstm_67 is the second layer.
lstm = K.function([model.layers[0].input], [model.layers[1].output])
lstm_output = lstm([test_x])[0]
Attractive Alpaca