diff --git a/mindspore/python/mindspore/nn/layer/image.py b/mindspore/python/mindspore/nn/layer/image.py index d8de0fbd1fd..0655fc3cde0 100644 --- a/mindspore/python/mindspore/nn/layer/image.py +++ b/mindspore/python/mindspore/nn/layer/image.py @@ -14,6 +14,7 @@ # ============================================================================ """image""" from __future__ import absolute_import +from __future__ import division import numbers import numpy as np diff --git a/mindspore/python/mindspore/nn/layer/normalization.py b/mindspore/python/mindspore/nn/layer/normalization.py index 7c25020477b..4bb4d068fdc 100644 --- a/mindspore/python/mindspore/nn/layer/normalization.py +++ b/mindspore/python/mindspore/nn/layer/normalization.py @@ -14,6 +14,7 @@ # ============================================================================ """normalization""" from __future__ import absolute_import +from __future__ import division import itertools import numbers diff --git a/mindspore/python/mindspore/ops/_grad_experimental/grad_math_ops.py b/mindspore/python/mindspore/ops/_grad_experimental/grad_math_ops.py index 823426bf775..b6afad7bac6 100644 --- a/mindspore/python/mindspore/ops/_grad_experimental/grad_math_ops.py +++ b/mindspore/python/mindspore/ops/_grad_experimental/grad_math_ops.py @@ -15,48 +15,47 @@ """Define the grad rules of math related operations.""" -from mindspore.common import dtype as mstype -from mindspore.ops.operations.math_ops import Trace, Bernoulli, Renorm -from mindspore.ops._utils.utils import is_shape_unknown -from mindspore import nn -import mindspore.numpy as mnp import numpy as np -from ...nn import LGamma -from .. import functional as F -from .. import operations as P -from ..operations.math_ops import Real, Imag, Complex, Angle -from ..operations.math_ops import ComplexAbs -from ..operations.math_ops import Sinc -from ..functional import broadcast_gradient_args -from .._grad.grad_base import bprop_getters, create_tensor_by_element, dyn_rank -from .._grad.grad_math_ops import binop_grad_common -from ..composite.multitype_ops.zeros_like_impl import zeros_like -from ..operations import _grad_ops as G -from ..operations.math_ops import Igamma, Igammac -from ..primitive import constexpr -from ..operations.math_ops import BesselI0 -from ..operations.math_ops import BesselI1 -from ..operations.math_ops import BesselJ0 -from ..operations.math_ops import BesselJ1 -from ..operations.math_ops import BesselK0 -from ..operations.math_ops import BesselK1 -from ..operations.math_ops import BesselK0e -from ..operations.math_ops import BesselK1e -from ..operations.math_ops import BesselY0 -from ..operations.math_ops import BesselY1 -from ..operations.math_ops import NextAfter -from ..operations.math_ops import Hypot -from ..operations.math_ops import ReduceStd -from ..operations.math_ops import LuUnpack -from ..operations.math_ops import MatrixExp -from ..operations.math_ops import MatrixSolve -from ..operations.math_ops import Median -from ..operations.math_ops import Betainc -from ..operations.math_ops import CholeskySolve -from ..operations.math_ops import AddV2 -from ..operations.math_ops import TridiagonalMatMul -from ..operations.math_ops import Logit -from .._utils.utils import is_shape_unknown +import mindspore.numpy as mnp +from mindspore.common import dtype as mstype +from mindspore import nn +from mindspore.nn import LGamma +from mindspore.ops import functional as F +from mindspore.ops.functional import broadcast_gradient_args +from mindspore.ops import operations as P +from mindspore.ops.operations.math_ops import Trace, Bernoulli, Renorm +from mindspore.ops.operations.math_ops import Real, Imag, Complex, Angle +from mindspore.ops.operations.math_ops import ComplexAbs +from mindspore.ops.operations.math_ops import Sinc +from mindspore.ops.operations import _grad_ops as G +from mindspore.ops.operations.math_ops import Igamma, Igammac +from mindspore.ops.operations.math_ops import BesselI0 +from mindspore.ops.operations.math_ops import BesselI1 +from mindspore.ops.operations.math_ops import BesselJ0 +from mindspore.ops.operations.math_ops import BesselJ1 +from mindspore.ops.operations.math_ops import BesselK0 +from mindspore.ops.operations.math_ops import BesselK1 +from mindspore.ops.operations.math_ops import BesselK0e +from mindspore.ops.operations.math_ops import BesselK1e +from mindspore.ops.operations.math_ops import BesselY0 +from mindspore.ops.operations.math_ops import BesselY1 +from mindspore.ops.operations.math_ops import NextAfter +from mindspore.ops.operations.math_ops import Hypot +from mindspore.ops.operations.math_ops import ReduceStd +from mindspore.ops.operations.math_ops import LuUnpack +from mindspore.ops.operations.math_ops import MatrixExp +from mindspore.ops.operations.math_ops import MatrixSolve +from mindspore.ops.operations.math_ops import Median +from mindspore.ops.operations.math_ops import Betainc +from mindspore.ops.operations.math_ops import CholeskySolve +from mindspore.ops.operations.math_ops import AddV2 +from mindspore.ops.operations.math_ops import TridiagonalMatMul +from mindspore.ops.operations.math_ops import Logit +from mindspore.ops.composite.multitype_ops.zeros_like_impl import zeros_like +from mindspore.ops.primitive import constexpr +from mindspore.ops._utils.utils import is_shape_unknown +from mindspore.ops._grad.grad_base import bprop_getters, create_tensor_by_element, dyn_rank +from mindspore.ops._grad.grad_math_ops import binop_grad_common transpose = P.Transpose() diff --git a/mindspore/python/mindspore/ops/operations/_grad_ops.py b/mindspore/python/mindspore/ops/operations/_grad_ops.py index f07e99e32a1..f51a711af73 100644 --- a/mindspore/python/mindspore/ops/operations/_grad_ops.py +++ b/mindspore/python/mindspore/ops/operations/_grad_ops.py @@ -14,6 +14,7 @@ # ============================================================================ """Operators for gradients.""" +from __future__ import division from mindspore._checkparam import _check_3d_int_or_tuple from mindspore.ops.operations.nn_ops import _check_positive_int_or_tuple diff --git a/mindspore/python/mindspore/ops/operations/math_ops.py b/mindspore/python/mindspore/ops/operations/math_ops.py index 3f6eeae7e79..b518ad75b35 100644 --- a/mindspore/python/mindspore/ops/operations/math_ops.py +++ b/mindspore/python/mindspore/ops/operations/math_ops.py @@ -16,6 +16,8 @@ """Operators for math.""" from __future__ import absolute_import +from __future__ import division + import numpy as np from mindspore import context from mindspore.ops import signature as sig