未验证 提交 fb82d72c 编写于 作者: Y Yibing Liu 提交者: GitHub

Move complex into dir incubate (#24254)

* Move complex into dir incubate, test=develop

* Fix imports, test=develop

* Fix docs, test=develop

* Forbid import functions from paddle.incubate directly, test=develop
上级 f800403f
......@@ -38,7 +38,7 @@ import paddle.tensor
import paddle.nn
import paddle.framework
import paddle.imperative
import paddle.complex
import paddle.incubate.complex as complex
# TODO: define alias in tensor and framework directory
from .tensor.random import randperm
......
......@@ -15,7 +15,7 @@
import unittest
import numpy as np
from numpy.random import random as rand
import paddle.complex as cpx
from paddle import complex as cpx
import paddle.fluid as fluid
import paddle.fluid.dygraph as dg
......
......@@ -13,7 +13,7 @@
# limitations under the License.
from paddle import fluid, tensor
import paddle.complex as cpx
import paddle
import paddle.fluid.dygraph as dg
import numpy as np
import unittest
......@@ -40,7 +40,7 @@ class ComplexKronTestCase(unittest.TestCase):
with dg.guard(place):
x_var = dg.to_variable(self.x)
y_var = dg.to_variable(self.y)
out_var = cpx.kron(x_var, y_var)
out_var = paddle.complex.kron(x_var, y_var)
np.testing.assert_allclose(out_var.numpy(), self.ref_result)
......
......@@ -13,7 +13,7 @@
# limitations under the License.
import paddle.fluid as fluid
import paddle.complex as cpx
from paddle import complex as cpx
import paddle.fluid.dygraph as dg
import numpy as np
import unittest
......
......@@ -15,7 +15,7 @@
import unittest
import numpy as np
from numpy.random import random as rand
import paddle.complex as cpx
from paddle import complex as cpx
import paddle.fluid as fluid
import paddle.fluid.dygraph as dg
......
......@@ -15,7 +15,7 @@
import unittest
import numpy as np
from numpy.random import random as rand
import paddle.complex as cpx
from paddle import complex as cpx
import paddle.fluid as fluid
import paddle.fluid.dygraph as dg
......
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
......@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from ..fluid import framework
from ...fluid import framework
def is_complex(x):
......
......@@ -13,8 +13,8 @@
# limitations under the License.
from ..helper import is_complex, is_real, complex_variable_exists
from ...fluid.framework import ComplexVariable
from ...fluid import layers
from ....fluid.framework import ComplexVariable
from ....fluid import layers
__all__ = ['matmul', ]
......@@ -26,10 +26,10 @@ def matmul(x, y, transpose_x=False, transpose_y=False, alpha=1.0, name=None):
Args:
x (ComplexVariable|Variable): The first input, can be a ComplexVariable
with data type complex32 or complex64, or a Variable with data type
with data type complex64 or complex128, or a Variable with data type
float32 or float64.
y (ComplexVariable|Variable): The second input, can be a ComplexVariable
with data type complex32 or complex64, or a Variable with data type
with data type complex64 or complex128, or a Variable with data type
float32 or float64.
transpose_x (bool): Whether to transpose :math:`x` before multiplication.
transpose_y (bool): Whether to transpose :math:`y` before multiplication.
......
......@@ -14,8 +14,8 @@
from paddle.common_ops_import import *
from ..helper import is_complex, is_real, complex_variable_exists
from ...fluid.framework import ComplexVariable
from ...fluid import layers
from ....fluid.framework import ComplexVariable
from ....fluid import layers
__all__ = [
'reshape',
......
......@@ -14,9 +14,9 @@
from paddle.common_ops_import import *
from ..helper import is_complex, is_real, complex_variable_exists
from ...fluid.framework import ComplexVariable
from ...fluid import layers
from ...tensor import math
from ....fluid.framework import ComplexVariable
from ....fluid import layers
from ....tensor import math
__all__ = [
'elementwise_add',
......@@ -368,6 +368,7 @@ def kron(x, y, name=None):
import numpy as np
import paddle
from paddle import fluid
import paddle.fluid.dygraph as dg
a = np.array([[1.0+1.0j, 2.0+1.0j], [3.0+1.0j, 4.0+1.0j]])
......
......@@ -139,8 +139,9 @@ packages=['paddle',
'paddle.dataset',
'paddle.reader',
'paddle.distributed',
'paddle.complex',
'paddle.complex.tensor',
'paddle.incubate',
'paddle.incubate.complex',
'paddle.incubate.complex.tensor',
'paddle.framework',
'paddle.fluid',
'paddle.fluid.dygraph',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册