czhang99/Capsule-NLU

Performance issue in the definition of masked_routing_iter, capsule_masked.py(P1)

Opened this issue · 0 comments

Hello, I found a performance issue in the definition of masked_routing_iter, capsule_masked.py, two tf.matmul and three tf.shape in line 82, 83 will be created repeatedly during program execution, resulting in reduced efficiency. I think they should be created before the loop.

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