参考 Keras学习笔记(二)Keras实现自定义层 疑问 compute_output_shape()中的input_shape包含batch_size吗?包含。 例1,参考博文1中的自定义层AttentionDecoder。 def build(self, input_shape): """ See Appendix 2 of Bahdanau 2014, arXiv:1409.0473 for model details that correspond to the matrices here. """ self.batch_size, self.timesteps, self