Skip to content

Commit 6279798

Browse files
Merge pull request #667 from InfiniTensor/issue/666
issue/666 - Standardized test imports
2 parents 5e85a4d + 61a7dc0 commit 6279798

File tree

268 files changed

+1472
-813
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

268 files changed

+1472
-813
lines changed

test/infinicore/framework/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
infinicore_tensor_from_torch,
1919
rearrange_tensor,
2020
convert_infinicore_to_torch,
21-
is_integer_dtype,
21+
is_broadcast,
2222
is_complex_dtype,
2323
is_floating_dtype,
24+
is_integer_dtype,
2425
)
2526

2627
__all__ = [
@@ -51,9 +52,10 @@
5152
"to_torch_dtype",
5253
"torch_device_map",
5354
# Type checking utilities
54-
"is_integer_dtype",
55+
"is_broadcast",
5556
"is_complex_dtype",
5657
"is_floating_dtype",
58+
"is_integer_dtype",
5759
# Benchmarking utilities
5860
"BenchmarkUtils",
5961
"BenchmarkResult",

test/infinicore/ops/abs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
import torch
77
import infinicore
8-
from framework.base import BaseOperatorTest, TensorSpec, TestCase
9-
from framework.runner import GenericTestRunner
8+
from framework import BaseOperatorTest, TensorSpec, TestCase, GenericTestRunner
109

1110
# Test cases format: (in_shape, in_strides_or_None)
1211
_TEST_CASES_DATA = [

test/infinicore/ops/acos.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55

66
import torch
77
import infinicore
8-
from framework.base import BaseOperatorTest, TensorSpec, TestCase
9-
from framework.runner import GenericTestRunner
10-
from framework.utils import is_broadcast
8+
from framework import (
9+
BaseOperatorTest,
10+
TensorSpec,
11+
TestCase,
12+
GenericTestRunner,
13+
is_broadcast,
14+
)
1115

1216
# =======================================================================
1317
# Test cases format: (shape, input_strides_or_None)

test/infinicore/ops/acosh.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55

66
import torch
77
import infinicore
8-
from framework.base import BaseOperatorTest, TensorSpec, TestCase
9-
from framework.runner import GenericTestRunner
10-
from framework.utils import is_broadcast
8+
from framework import (
9+
BaseOperatorTest,
10+
TensorSpec,
11+
TestCase,
12+
GenericTestRunner,
13+
is_broadcast,
14+
)
1115

1216
# =======================================================================
1317
# Test cases format: (shape, input_strides_or_None)

test/infinicore/ops/adaptive_avg_pool1d.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55

66
import torch
77
import infinicore
8-
from framework.base import BaseOperatorTest, TensorSpec, TestCase
9-
from framework.runner import GenericTestRunner
10-
from framework.utils import is_broadcast
8+
from framework import (
9+
BaseOperatorTest,
10+
TensorSpec,
11+
TestCase,
12+
GenericTestRunner,
13+
is_broadcast,
14+
)
1115

1216
# Test cases format: (in_shape, in_strides_or_None, output_size_or_None)
1317

test/infinicore/ops/adaptive_avg_pool2d.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55

66
import torch
77
import infinicore
8-
from framework.base import BaseOperatorTest, TensorSpec, TestCase
9-
from framework.runner import GenericTestRunner
10-
from framework.utils import is_broadcast
8+
from framework import (
9+
BaseOperatorTest,
10+
TensorSpec,
11+
TestCase,
12+
GenericTestRunner,
13+
is_broadcast,
14+
)
1115

1216
# Test cases format: (in_shape, in_strides_or_None, output_size_or_None)
1317
# adaptive_avg_pool2d maps input HxW to target output size (h, w)

test/infinicore/ops/adaptive_avg_pool3d.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55

66
import torch
77
import infinicore
8-
from framework.base import BaseOperatorTest, TensorSpec, TestCase
9-
from framework.runner import GenericTestRunner
10-
from framework.utils import is_broadcast
8+
from framework import (
9+
BaseOperatorTest,
10+
TensorSpec,
11+
TestCase,
12+
GenericTestRunner,
13+
is_broadcast,
14+
)
1115

1216
# Test cases format: (in_shape, in_strides_or_None, output_size_or_None)
1317
# adaptive_avg_pool3d maps input D x H x W to target output size (d, h, w)

test/infinicore/ops/adaptive_max_pool1d.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55

66
import torch
77
import infinicore
8-
from framework.base import BaseOperatorTest, TensorSpec, TestCase
9-
from framework.runner import GenericTestRunner
10-
from framework.utils import is_broadcast
8+
from framework import (
9+
BaseOperatorTest,
10+
TensorSpec,
11+
TestCase,
12+
GenericTestRunner,
13+
is_broadcast,
14+
)
1115

1216
# Test cases format: (in_shape, in_strides_or_None, output_size_or_None)
1317

test/infinicore/ops/adaptive_max_pool2d.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55

66
import torch
77
import infinicore
8-
from framework.base import BaseOperatorTest, TensorSpec, TestCase, TestResult
9-
from framework.runner import GenericTestRunner
10-
from framework.utils import is_broadcast
8+
from framework import (
9+
BaseOperatorTest,
10+
TensorSpec,
11+
TestCase,
12+
GenericTestRunner,
13+
is_broadcast,
14+
)
1115
from framework.devices import InfiniDeviceEnum
1216

1317
# Test cases format: (in_shape, in_strides_or_None, output_size_or_None)

test/infinicore/ops/add.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55

66
import torch
77
import infinicore
8-
from framework.base import BaseOperatorTest, TensorSpec, TestCase
9-
from framework.runner import GenericTestRunner
10-
from framework.utils import is_broadcast
8+
from framework import (
9+
BaseOperatorTest,
10+
TensorSpec,
11+
TestCase,
12+
GenericTestRunner,
13+
is_broadcast,
14+
)
1115

1216
# ==============================================================================
1317
# Operator-specific configuration

0 commit comments

Comments
 (0)