fix python lint of hypercomplex

This commit is contained in:
chenhaozhe 2023-06-19 13:50:50 +03:00
parent b4052c054f
commit 691e7ad0e0
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):