Refine lib -> xautodl
This commit is contained in:
@@ -8,17 +8,12 @@ import unittest
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / "lib").resolve()
|
||||
print("library path: {:}".format(lib_dir))
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
|
||||
from spaces import Categorical
|
||||
from spaces import Continuous
|
||||
from spaces import Integer
|
||||
from spaces import is_determined
|
||||
from spaces import get_min
|
||||
from spaces import get_max
|
||||
from xautodl.spaces import Categorical
|
||||
from xautodl.spaces import Continuous
|
||||
from xautodl.spaces import Integer
|
||||
from xautodl.spaces import is_determined
|
||||
from xautodl.spaces import get_min
|
||||
from xautodl.spaces import get_max
|
||||
|
||||
|
||||
class TestBasicSpace(unittest.TestCase):
|
||||
|
24
tests/test_import.py
Normal file
24
tests/test_import.py
Normal file
@@ -0,0 +1,24 @@
|
||||
#####################################################
|
||||
# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2021.03 #
|
||||
#####################################################
|
||||
# pytest ./tests/test_import.py #
|
||||
#####################################################
|
||||
import os, sys, time, torch
|
||||
import pickle
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_import():
|
||||
from xautodl import config_utils
|
||||
from xautodl import datasets
|
||||
from xautodl import log_utils
|
||||
from xautodl import models
|
||||
from xautodl import nas_infer_model
|
||||
from xautodl import procedures
|
||||
from xautodl import spaces
|
||||
from xautodl import trade_models
|
||||
from xautodl import utils
|
||||
from xautodl import xlayers
|
||||
|
||||
print("Check all imports done")
|
@@ -3,16 +3,10 @@
|
||||
#####################################################
|
||||
# pytest tests/test_math_adv.py -s #
|
||||
#####################################################
|
||||
import sys, random
|
||||
import unittest
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / "lib").resolve()
|
||||
print("library path: {:}".format(lib_dir))
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
|
||||
from xautodl import datasets
|
||||
from datasets.math_core import QuadraticFunc
|
||||
from datasets.math_core import ConstantFunc
|
||||
from datasets.math_core import DynamicLinearFunc
|
||||
|
@@ -3,17 +3,9 @@
|
||||
#####################################################
|
||||
# pytest tests/test_math_base.py -s #
|
||||
#####################################################
|
||||
import sys, random
|
||||
import unittest
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / "lib").resolve()
|
||||
print("library path: {:}".format(lib_dir))
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
|
||||
from datasets.math_core import QuadraticFunc
|
||||
from xautodl.datasets.math_core import QuadraticFunc
|
||||
|
||||
|
||||
class TestQuadraticFunc(unittest.TestCase):
|
||||
|
@@ -6,17 +6,12 @@
|
||||
import sys, random
|
||||
import unittest
|
||||
from parameterized import parameterized
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / "lib").resolve()
|
||||
print("library path: {:}".format(lib_dir))
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
|
||||
import torch
|
||||
from xlayers import super_core
|
||||
import spaces
|
||||
|
||||
from xautodl import spaces
|
||||
from xautodl.xlayers import super_core
|
||||
|
||||
|
||||
class TestSuperAttention(unittest.TestCase):
|
||||
|
@@ -8,14 +8,9 @@ import unittest
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / "lib").resolve()
|
||||
print("library path: {:}".format(lib_dir))
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
|
||||
import torch
|
||||
from xlayers import super_core
|
||||
import spaces
|
||||
from xautodl import spaces
|
||||
from xautodl.xlayers import super_core
|
||||
|
||||
|
||||
"""Test the super container layers."""
|
||||
|
@@ -3,19 +3,11 @@
|
||||
#####################################################
|
||||
# pytest ./tests/test_super_model.py -s #
|
||||
#####################################################
|
||||
import sys, random
|
||||
import unittest
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / "lib").resolve()
|
||||
print("library path: {:}".format(lib_dir))
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
|
||||
import torch
|
||||
from xlayers import super_core
|
||||
import spaces
|
||||
import unittest
|
||||
|
||||
from xautodl.xlayers import super_core
|
||||
from xautodl import spaces
|
||||
|
||||
|
||||
class TestSuperLinear(unittest.TestCase):
|
||||
|
@@ -3,19 +3,11 @@
|
||||
#####################################################
|
||||
# pytest ./tests/test_super_norm.py -s #
|
||||
#####################################################
|
||||
import sys, random
|
||||
import unittest
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / "lib").resolve()
|
||||
print("library path: {:}".format(lib_dir))
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
|
||||
import torch
|
||||
from xlayers import super_core
|
||||
import spaces
|
||||
from xautodl.xlayers import super_core
|
||||
from xautodl import spaces
|
||||
|
||||
|
||||
class TestSuperSimpleNorm(unittest.TestCase):
|
||||
|
@@ -8,14 +8,8 @@
|
||||
import os, sys, time, torch
|
||||
import pickle
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
lib_dir = (Path(__file__).parent / ".." / "lib").resolve()
|
||||
print("library path: {:}".format(lib_dir))
|
||||
if str(lib_dir) not in sys.path:
|
||||
sys.path.insert(0, str(lib_dir))
|
||||
|
||||
from trade_models.quant_transformer import QuantTransformer
|
||||
from xautodl.trade_models.quant_transformer import QuantTransformer
|
||||
|
||||
|
||||
def test_create():
|
||||
|
Reference in New Issue
Block a user