forked from mindspore-Ecosystem/mindspore
commit
2e684e89e7
|
@ -45,7 +45,6 @@ class Net(nn.Cell):
|
|||
@non_graph_engine
|
||||
def test_AssignAdd_1():
|
||||
"""test AssignAdd 1"""
|
||||
import mindspore.context as context
|
||||
context.set_context(mode=context.GRAPH_MODE)
|
||||
net = Net()
|
||||
x = Tensor(np.ones([1]).astype(np.int64) * 100)
|
||||
|
@ -65,7 +64,6 @@ def test_AssignAdd_1():
|
|||
@non_graph_engine
|
||||
def test_AssignAdd_2():
|
||||
"""test AssignAdd 2"""
|
||||
import mindspore.context as context
|
||||
context.set_context(mode=context.GRAPH_MODE)
|
||||
net = Net()
|
||||
x = Tensor(np.ones([1]).astype(np.int64) * 102)
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
# limitations under the License.
|
||||
# ============================================================================
|
||||
"""test_dtype"""
|
||||
from dataclasses import dataclass
|
||||
import numpy as np
|
||||
import pytest
|
||||
from dataclasses import dataclass
|
||||
|
||||
import mindspore as ms
|
||||
from mindspore.common import dtype
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# ============================================================================
|
||||
import numpy as np
|
||||
from collections import Counter
|
||||
import numpy as np
|
||||
|
||||
import mindspore.nn as nn
|
||||
from mindspore import Tensor, Parameter
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
# limitations under the License.
|
||||
# ============================================================================
|
||||
""" test container """
|
||||
from collections import OrderedDict
|
||||
import numpy as np
|
||||
import pytest
|
||||
from collections import OrderedDict
|
||||
|
||||
import mindspore.nn as nn
|
||||
from mindspore import Tensor
|
||||
|
|
|
@ -54,7 +54,6 @@ def test_parameter_tuple_illegal():
|
|||
|
||||
|
||||
def test_parameter_init_illegal():
|
||||
import numpy as np
|
||||
dat = np.array([[1, 2, 3], [2, 3, 4]])
|
||||
tensor = Tensor(dat)
|
||||
data_none = None
|
||||
|
|
|
@ -13,13 +13,11 @@
|
|||
# limitations under the License.
|
||||
# ============================================================================
|
||||
"""ut for model serialize(save/load)"""
|
||||
import numpy as np
|
||||
import os
|
||||
import pytest
|
||||
import stat
|
||||
import time
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
import mindspore.common.dtype as mstype
|
||||
import mindspore.nn as nn
|
||||
from mindspore import context
|
||||
from mindspore.common.parameter import Parameter
|
||||
|
|
|
@ -20,8 +20,8 @@ Usage:
|
|||
"""
|
||||
|
||||
import argparse
|
||||
import numpy as np
|
||||
import os
|
||||
import numpy as np
|
||||
|
||||
import mindspore.context as context
|
||||
import mindspore.nn as nn
|
||||
|
|
|
@ -17,7 +17,6 @@ import numpy as np
|
|||
from mobilenetv2_combined import MobileNetV2
|
||||
|
||||
import mindspore.context as context
|
||||
import mindspore.ops.operations as P
|
||||
from mindspore import Tensor
|
||||
from mindspore import nn
|
||||
from mindspore.nn.layer import combined
|
||||
|
|
|
@ -14,8 +14,8 @@
|
|||
# ============================================================================
|
||||
""" test_graph_summary """
|
||||
import logging
|
||||
import numpy as np
|
||||
import os
|
||||
import numpy as np
|
||||
|
||||
import mindspore.nn as nn
|
||||
from mindspore import Model, context
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
"""Test histogram summary."""
|
||||
|
||||
import logging
|
||||
import numpy as np
|
||||
import os
|
||||
import tempfile
|
||||
import numpy as np
|
||||
|
||||
from mindspore.common.tensor import Tensor
|
||||
from mindspore.train.summary._summary_adapter import _calc_histogram_bins
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
@Desc : test summary function
|
||||
"""
|
||||
import logging
|
||||
import numpy as np
|
||||
import os
|
||||
import numpy as np
|
||||
|
||||
import mindspore.nn as nn
|
||||
from mindspore import Model, context
|
||||
|
|
|
@ -19,10 +19,11 @@
|
|||
@Desc : test summary function
|
||||
"""
|
||||
import logging
|
||||
import numpy as np
|
||||
import os
|
||||
import pytest
|
||||
import random
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
|
||||
import mindspore.nn as nn
|
||||
from mindspore.common.tensor import Tensor
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
@Desc : test summary function of abnormal input
|
||||
"""
|
||||
import logging
|
||||
import numpy as np
|
||||
import os
|
||||
import numpy as np
|
||||
|
||||
from mindspore.common.tensor import Tensor
|
||||
from mindspore.train.summary.summary_record import SummaryRecord
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
@Desc : test summary function
|
||||
"""
|
||||
import logging
|
||||
import numpy as np
|
||||
import os
|
||||
import numpy as np
|
||||
|
||||
import mindspore.nn as nn
|
||||
from mindspore.common.tensor import Tensor
|
||||
|
|
|
@ -13,10 +13,10 @@
|
|||
# limitations under the License.
|
||||
# ============================================================================
|
||||
"""test callback function."""
|
||||
import numpy as np
|
||||
import os
|
||||
import pytest
|
||||
import stat
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
import mindspore.common.dtype as mstype
|
||||
import mindspore.nn as nn
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
# ============================================================================
|
||||
""" test_initializer """
|
||||
import math
|
||||
from functools import reduce
|
||||
import numpy as np
|
||||
import pytest as py
|
||||
from functools import reduce
|
||||
from scipy import stats
|
||||
|
||||
import mindspore as ms
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
# limitations under the License.
|
||||
# ============================================================================
|
||||
"""ut for model serialize(save/load)"""
|
||||
import numpy as np
|
||||
import os
|
||||
import pytest
|
||||
import stat
|
||||
import time
|
||||
import pytest
|
||||
import numpy as np
|
||||
|
||||
import mindspore.common.dtype as mstype
|
||||
import mindspore.nn as nn
|
||||
|
@ -31,7 +31,7 @@ from mindspore.ops import operations as P
|
|||
from mindspore.train.callback import _CheckpointManager
|
||||
from mindspore.train.serialization import save_checkpoint, load_checkpoint, load_param_into_net, \
|
||||
_exec_save_checkpoint, export, _save_graph
|
||||
from ..ut_filter import run_on_onnxruntime, non_graph_engine
|
||||
from ..ut_filter import non_graph_engine
|
||||
|
||||
context.set_context(mode=context.GRAPH_MODE)
|
||||
|
||||
|
|
Loading…
Reference in New Issue