improve efficiency of dot op in dygraph mode (#23856)

* improve efficiency of dot op in dygraph mode

* add comments for dot op for dygraph behavior
revert-22778-infer_var_type
liuwei1031 5 years ago committed by GitHub
parent 53cfac9492
commit c645d23519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -440,6 +440,11 @@ def dot(x, y, name=None):
"""
op_type = 'dot'
# skip var type check in dygraph mode to improve efficiency
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)

Loading…
Cancel
Save