From 3d846fc3f28f136b52a0dd39fc608ac5bc9b0ad4 Mon Sep 17 00:00:00 2001 From: wanghaoshuang Date: Wed, 2 May 2018 15:45:08 +0800 Subject: [PATCH] Make Variable support for future.division. --- python/paddle/fluid/layers/math_op_patch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/paddle/fluid/layers/math_op_patch.py b/python/paddle/fluid/layers/math_op_patch.py index 08a0184c2c2..1754061c4ba 100644 --- a/python/paddle/fluid/layers/math_op_patch.py +++ b/python/paddle/fluid/layers/math_op_patch.py @@ -169,7 +169,9 @@ def monkey_patch_variable(): # a*b == b*a. Do not need to reverse explicitly ("__rmul__", "elementwise_mul", False), ("__div__", "elementwise_div", False), + ("__truediv__", "elementwise_div", False), ("__rdiv__", "elementwise_div", True), + ("__rtruediv__", "elementwise_div", True), ("__pow__", "elementwise_pow", False), ("__rpow__", "elementwise_pow", True), # for logical compare -- GitLab