I can’t edit my post. I need to edit the first code. The right first code is the following:
history = compile_and_fit(lstm_model, wide_window)

IPython.display.clear_output()
val_performance['LSTM'] = lstm_model.evaluate(wide_window.val)
performance['LSTM'] = lstm_model.evaluate(wide_window.test, verbose=0)

Sorry for the error. I also posted a question about this in Stack Overflow: https://stackoverflow.com/questions/69059787/error-from-code-adapted-from-tutorial-about-time-series-forecasting-from-tensorf 35
Thanks.