nematus icon indicating copy to clipboard operation
nematus copied to clipboard

Performance issues in the difinition of generate_initial_memories, nematus/transformer_inference.py

Open DLPerf opened this issue 4 years ago • 1 comments

Hello, I found two performance issues in the definition of generate_initial_memories, nematus/transformer_inference.py, tf.zeros in line 133 and 135 will be calculated repeatedly during program execution, resulting in reduced efficiency. I think it should be created before the loop in generate_initial_memories.

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

DLPerf avatar Aug 12 '21 11:08 DLPerf

thank you for this report. I'm happy to accept PRs that improve efficiency.

rsennrich avatar Aug 13 '21 15:08 rsennrich