brightmart / text_classification

all kinds of text classification models and more with deep learning
MIT License
7.83k stars 2.57k forks source link

Performance issue in the definition of answer_module, a09_DynamicMemoryNet/a8_dynamic_memory_network.py #146

Open DLPerf opened 3 years ago

DLPerf commented 3 years ago

Hello, I found a performance issue in the definition of answer_module, a09_DynamicMemoryNet/a8_dynamic_memory_network.py, tf.concat will created repeatedly(tensorflow 1.x) during program execution, resulting in reduced efficiency. I think it should be created before the loop in answer_module.

Looking forward to your reply. Btw, I am very glad to create a PR to fix it if you are too busy.

brightmart commented 3 years ago

Thanks for feedback. please create a PR.