nlp-architect icon indicating copy to clipboard operation
nlp-architect copied to clipboard

Performance issue in the definition of _inference, examples/memn2n_dialogue/memn2n_dialogue.py(P1)

Open DLPerf opened this issue 4 years ago • 2 comments

Hello, I found a performance issue in the difinition of _inference, examples/memn2n_dialogue/memn2n_dialogue.py, tf.nn.embedding_lookup will be calculated repeately during the program execution, resulting in reduced efficiency. So I think it should be created before the loop.

The same issue exist in tf.reduce_sum in line 187 and 200.

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 20 '21 11:08 DLPerf

@danielkorat Hi, my friend, could you consider my issue?

DLPerf avatar Sep 03 '21 13:09 DLPerf

Hi @DLPerf, thanks for letting us know about the issue. You can open a PR to fix the issue if you wish. Any contribution is welcome.

peteriz avatar Sep 05 '21 12:09 peteriz