|
|
@ -143,7 +143,11 @@ def monkey_patch_variable():
|
|
|
|
reverse=False,
|
|
|
|
reverse=False,
|
|
|
|
scalar_method=None):
|
|
|
|
scalar_method=None):
|
|
|
|
def __impl__(self, other_var):
|
|
|
|
def __impl__(self, other_var):
|
|
|
|
if scalar_method is not None:
|
|
|
|
# FIXME(zjl): elementwise_div between integers cannot be converted to scale,
|
|
|
|
|
|
|
|
# which may lose accuracy. This is a hot fix for release 1.6.
|
|
|
|
|
|
|
|
if scalar_method is not None and not (
|
|
|
|
|
|
|
|
op_type == 'elementwise_div' and
|
|
|
|
|
|
|
|
self.dtype in _supported_int_dtype_):
|
|
|
|
if isinstance(other_var, float):
|
|
|
|
if isinstance(other_var, float):
|
|
|
|
if self.dtype in _supported_int_dtype_:
|
|
|
|
if self.dtype in _supported_int_dtype_:
|
|
|
|
assert other_var == int(other_var), \
|
|
|
|
assert other_var == int(other_var), \
|
|
|
|