Unverified Commit 62797984 authored by PanZezhong1725's avatar PanZezhong1725 Committed by GitHub
Browse files

Merge pull request #667 from InfiniTensor/issue/666

issue/666 - Standardized test imports
parents 5e85a4d8 61a7dc0e
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# ============================================================================== # ==============================================================================
# Operator-specific configuration for aminmax # Operator-specific configuration for aminmax
......
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# Test cases format: (in_shape, in_strides_or_None, dim_or_None, keepdim_or_None, out_strides_or_None) # Test cases format: (in_shape, in_strides_or_None, dim_or_None, keepdim_or_None, out_strides_or_None)
......
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# Test cases format: (in_shape, in_strides_or_None, dim_or_None, keepdim_or_None) # Test cases format: (in_shape, in_strides_or_None, dim_or_None, keepdim_or_None)
......
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# Test cases format: (in_shape, in_strides_or_None, dim_or_None, keepdim_or_None) # Test cases format: (in_shape, in_strides_or_None, dim_or_None, keepdim_or_None)
......
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# Test cases format: (shape, input_strides, dim, descending) # Test cases format: (shape, input_strides, dim, descending)
_TEST_CASES_DATA = [ _TEST_CASES_DATA = [
......
...@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import BaseOperatorTest, TensorSpec, TestCase, GenericTestRunner
from framework.runner import GenericTestRunner
# Test cases format: (input_shape, input_strides_or_None) # Test cases format: (input_shape, input_strides_or_None)
_TEST_CASES_DATA = [ _TEST_CASES_DATA = [
......
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# ======================================================================= # =======================================================================
# Test cases format: (shape, input_strides_or_None) # Test cases format: (shape, input_strides_or_None)
......
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# ======================================================================= # =======================================================================
# Test cases format: (shape, input_strides_or_None) # Test cases format: (shape, input_strides_or_None)
......
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# ======================================================================= # =======================================================================
# Test cases format: (shape, input_strides_or_None) # Test cases format: (shape, input_strides_or_None)
......
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# ======================================================================= # =======================================================================
# Test cases format: (shape, a_strides_or_None, b_strides_or_None, out_strides_or_None) # Test cases format: (shape, a_strides_or_None, b_strides_or_None, out_strides_or_None)
......
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# ======================================================================= # =======================================================================
# Test cases format: (shape, input_strides_or_None) # Test cases format: (shape, input_strides_or_None)
......
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# Test cases format: (in_shape, in_strides_or_None, kernel_size, stride_or_None, padding) # Test cases format: (in_shape, in_strides_or_None, kernel_size, stride_or_None, padding)
......
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# Test cases: (in_shape, in_strides_or_None, kernel_size, stride_or_None, padding) # Test cases: (in_shape, in_strides_or_None, kernel_size, stride_or_None, padding)
......
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# Test cases format: (in_shape, in_strides_or_None, kernel_size, stride_or_None, padding) # Test cases format: (in_shape, in_strides_or_None, kernel_size, stride_or_None, padding)
......
...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import (
from framework.runner import GenericTestRunner BaseOperatorTest,
from framework.utils import is_broadcast TensorSpec,
TestCase,
GenericTestRunner,
is_broadcast,
)
# Test cases format: (input_shape, batch1_shape, batch2_shape, input_strides_or_None, batch1_strides_or_None, batch2_strides_or_None, beta_or_None, alpha_or_None) # Test cases format: (input_shape, batch1_shape, batch2_shape, input_strides_or_None, batch1_strides_or_None, batch2_strides_or_None, beta_or_None, alpha_or_None)
......
...@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import BaseOperatorTest, TensorSpec, TestCase, GenericTestRunner
from framework.runner import GenericTestRunner
# Test cases format: (input_shape, input_strides_or_None, running_mean_present_bool, running_var_present_bool, weight_bias_present_bool, training_or_None, momentum_or_None, eps_or_None) # Test cases format: (input_shape, input_strides_or_None, running_mean_present_bool, running_var_present_bool, weight_bias_present_bool, training_or_None, momentum_or_None, eps_or_None)
_TEST_CASES_DATA = [ _TEST_CASES_DATA = [
......
...@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import BaseOperatorTest, TensorSpec, TestCase, GenericTestRunner
from framework.runner import GenericTestRunner
# Test cases format: (in1_shape, in2_shape, weight_shape, in1_strides_or_None, in2_strides_or_None, weight_strides_or_None, bias_present_bool) # Test cases format: (in1_shape, in2_shape, weight_shape, in1_strides_or_None, in2_strides_or_None, weight_strides_or_None, bias_present_bool)
......
...@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import BaseOperatorTest, TensorSpec, TestCase, GenericTestRunner
from framework.runner import GenericTestRunner
# Test cases format: (input_shape, input_strides_or_None, weight_present_bool, reduction_or_None) # Test cases format: (input_shape, input_strides_or_None, weight_present_bool, reduction_or_None)
......
...@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import BaseOperatorTest, TensorSpec, TestCase, GenericTestRunner
from framework.runner import GenericTestRunner
# Test cases format: (input_shape, input_strides_or_None, weight_present_bool, pos_weight_present_bool, reduction_or_None) # Test cases format: (input_shape, input_strides_or_None, weight_present_bool, pos_weight_present_bool, reduction_or_None)
......
...@@ -5,9 +5,8 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) ...@@ -5,9 +5,8 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import torch import torch
import infinicore import infinicore
from framework.base import BaseOperatorTest, TensorSpec, TestCase from framework import BaseOperatorTest, TensorSpec, TestCase, GenericTestRunner
from framework.tensor import TensorInitializer from framework.tensor import TensorInitializer
from framework.runner import GenericTestRunner
# Test cases format: (input_shape, input_strides_or_None, weights_present_bool, minlength) # Test cases format: (input_shape, input_strides_or_None, weights_present_bool, minlength)
_TEST_CASES_DATA = [ _TEST_CASES_DATA = [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment