!55460 fix pylint in hypercomplex

Merge pull request !55460 from chenhaozhe/hypercomplex_fix_lint
This commit is contained in:
i-robot 2023-06-27 07:16:56 +00:00 committed by Gitee
commit 4909c5332b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 3 additions and 2 deletions

View File

@ -13,7 +13,7 @@
# limitations under the License.
# ============================================================================
"""Complex Operators"""
from mindspore.hypercomplex.complex.complex_operators import ReLU
from mindspore.hypercomplex.complex.complex_relu import ReLU
from mindspore.hypercomplex.complex.complex_operators import Conv1d, Conv2d, Conv3d
from mindspore.hypercomplex.complex.complex_operators import BatchNorm1d, BatchNorm2d, BatchNorm3d
from mindspore.hypercomplex.complex.complex_operators import Dense

View File

@ -30,7 +30,7 @@ from mindspore.hypercomplex.complex._complex_conv_impl import _ReImConvImpl as C
from mindspore.hypercomplex.hypercomplex.hc_dense import Dense as HDense
from mindspore.hypercomplex.complex._complex_dense_impl import _DenseImpl as DenseImpl, \
_KaratsubaDenseImpl as KaratsubaDenseImpl
# ReLU
from mindspore.hypercomplex.hypercomplex.uniform_operator import _UniformOperator
from mindspore.hypercomplex.utils import _size_1_t, _size_2_t, _size_3_t

View File

@ -31,6 +31,7 @@ def get_x_and_y(tensor):
def to_2channel(real, imag, dtype=None):
"""combine real and image data to a complex number"""
if dtype is not None and dtype == mindspore.complex64:
return to_complex(real, imag)
if dtype is not None and (dtype != real.dtype or dtype != imag.dtype):