From 8566b26b6842b47029610a467324a16b6d44f7d1 Mon Sep 17 00:00:00 2001 From: liuwei1031 <46661762+liuwei1031@users.noreply.github.com> Date: Wed, 15 Apr 2020 11:26:13 +0800 Subject: [PATCH] improve efficiency of dot op in dygraph mode (#23857) --- python/paddle/tensor/linalg.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/paddle/tensor/linalg.py b/python/paddle/tensor/linalg.py index a62524c8e67..2a6ffc0ab66 100644 --- a/python/paddle/tensor/linalg.py +++ b/python/paddle/tensor/linalg.py @@ -440,6 +440,10 @@ def dot(x, y, name=None): """ op_type = 'dot' + if in_dygraph_mode(): + op = getattr(core.ops, op_type) + return op(x, y) + assert x is not None, 'x cannot be None in {}'.format(op_type) assert y is not None, 'y cannot be None in {}'.format(op_type) -- GitLab