Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jerrrrry
infinicore
Commits
61a7dc0e
Commit
61a7dc0e
authored
Nov 24, 2025
by
wooway777
Browse files
issue/666 - Standardized test imports
parent
406c9668
Changes
268
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
100 additions
and
76 deletions
+100
-76
test/infinicore/ops/logdet.py
test/infinicore/ops/logdet.py
+1
-2
test/infinicore/ops/logical_and.py
test/infinicore/ops/logical_and.py
+7
-3
test/infinicore/ops/logical_not.py
test/infinicore/ops/logical_not.py
+7
-3
test/infinicore/ops/logical_or.py
test/infinicore/ops/logical_or.py
+7
-3
test/infinicore/ops/logical_xor.py
test/infinicore/ops/logical_xor.py
+7
-3
test/infinicore/ops/logsigmoid.py
test/infinicore/ops/logsigmoid.py
+7
-3
test/infinicore/ops/logsumexp.py
test/infinicore/ops/logsumexp.py
+7
-3
test/infinicore/ops/lp_pool1d.py
test/infinicore/ops/lp_pool1d.py
+1
-2
test/infinicore/ops/lp_pool2d.py
test/infinicore/ops/lp_pool2d.py
+1
-2
test/infinicore/ops/lp_pool3d.py
test/infinicore/ops/lp_pool3d.py
+1
-2
test/infinicore/ops/margin_ranking_loss.py
test/infinicore/ops/margin_ranking_loss.py
+1
-2
test/infinicore/ops/masked_select.py
test/infinicore/ops/masked_select.py
+1
-2
test/infinicore/ops/matmul.py
test/infinicore/ops/matmul.py
+7
-3
test/infinicore/ops/matrix_exp.py
test/infinicore/ops/matrix_exp.py
+1
-2
test/infinicore/ops/matrix_power.py
test/infinicore/ops/matrix_power.py
+1
-2
test/infinicore/ops/max.py
test/infinicore/ops/max.py
+7
-3
test/infinicore/ops/max_pool1d.py
test/infinicore/ops/max_pool1d.py
+1
-2
test/infinicore/ops/max_pool2d.py
test/infinicore/ops/max_pool2d.py
+1
-2
test/infinicore/ops/max_pool3d.py
test/infinicore/ops/max_pool3d.py
+1
-2
test/infinicore/ops/max_unpool1d.py
test/infinicore/ops/max_unpool1d.py
+33
-30
No files found.
test/infinicore/ops/logdet.py
View file @
61a7dc0e
...
@@ -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: (matrix_shape, strides_or_None)
# Test cases format: (matrix_shape, strides_or_None)
# logdet(input) — returns (sign, logabsdet) in PyTorch
# logdet(input) — returns (sign, logabsdet) in PyTorch
...
...
test/infinicore/ops/logical_and.py
View file @
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
,
)
# 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)
# logical_and performs element-wise boolean AND; inputs may be bool or integer
# logical_and performs element-wise boolean AND; inputs may be bool or integer
...
...
test/infinicore/ops/logical_not.py
View file @
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
,
)
# Test cases format: (shape, input_strides_or_None, out_strides_or_None)
# Test cases format: (shape, input_strides_or_None, out_strides_or_None)
# logical_not negates boolean values
# logical_not negates boolean values
...
...
test/infinicore/ops/logical_or.py
View file @
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
,
)
# 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)
# logical_or performs element-wise boolean OR
# logical_or performs element-wise boolean OR
...
...
test/infinicore/ops/logical_xor.py
View file @
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
,
)
# 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)
# logical_xor performs element-wise boolean XOR
# logical_xor performs element-wise boolean XOR
...
...
test/infinicore/ops/logsigmoid.py
View file @
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
,
)
# Test cases format: (in_shape, in_strides_or_None)
# Test cases format: (in_shape, in_strides_or_None)
...
...
test/infinicore/ops/logsumexp.py
View file @
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
,
)
# Test cases format: (in_shape, in_strides_or_None, dim, keepdim_or_None, out_strides_or_None)
# Test cases format: (in_shape, in_strides_or_None, dim, keepdim_or_None, out_strides_or_None)
# logsumexp computes log(sum(exp(input), dim=dim)) with numerical stability
# logsumexp computes log(sum(exp(input), dim=dim)) with numerical stability
...
...
test/infinicore/ops/lp_pool1d.py
View file @
61a7dc0e
...
@@ -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: (in_shape, in_strides_or_None, norm_type, kernel_size, stride_or_None, ceil_mode)
# Test cases format: (in_shape, in_strides_or_None, norm_type, kernel_size, stride_or_None, ceil_mode)
...
...
test/infinicore/ops/lp_pool2d.py
View file @
61a7dc0e
...
@@ -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: (in_shape, in_strides_or_None, norm_type, kernel_size, stride_or_None, ceil_mode)
# Test cases format: (in_shape, in_strides_or_None, norm_type, kernel_size, stride_or_None, ceil_mode)
...
...
test/infinicore/ops/lp_pool3d.py
View file @
61a7dc0e
...
@@ -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: (in_shape, in_strides_or_None, norm_type, kernel_size, stride_or_None, ceil_mode)
# Test cases format: (in_shape, in_strides_or_None, norm_type, kernel_size, stride_or_None, ceil_mode)
...
...
test/infinicore/ops/margin_ranking_loss.py
View file @
61a7dc0e
...
@@ -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: (input1_shape, input2_shape, target_shape, input1_strides_or_None, input2_strides_or_None, target_strides_or_None, margin_or_None, p_or_None)
# Test cases format: (input1_shape, input2_shape, target_shape, input1_strides_or_None, input2_strides_or_None, target_strides_or_None, margin_or_None, p_or_None)
# infinicore.nn.functional.margin_ranking_loss(input1, input2, target, margin=0, p=1, reduction='mean')
# infinicore.nn.functional.margin_ranking_loss(input1, input2, target, margin=0, p=1, reduction='mean')
...
...
test/infinicore/ops/masked_select.py
View file @
61a7dc0e
...
@@ -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, mask_shape)
# Test cases format: (input_shape, input_strides_or_None, mask_shape)
_TEST_CASES_DATA
=
[
_TEST_CASES_DATA
=
[
...
...
test/infinicore/ops/matmul.py
View file @
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
# Operator-specific configuration
...
...
test/infinicore/ops/matrix_exp.py
View file @
61a7dc0e
...
@@ -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: (matrix_shape, strides_or_None)
# Test cases format: (matrix_shape, strides_or_None)
# infinicore.matrix_exp(input)
# infinicore.matrix_exp(input)
...
...
test/infinicore/ops/matrix_power.py
View file @
61a7dc0e
...
@@ -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: (matrix_shape, strides_or_None, n_or_None)
# Test cases format: (matrix_shape, strides_or_None, n_or_None)
# infinicore.matrix_power(input, n)
# infinicore.matrix_power(input, n)
...
...
test/infinicore/ops/max.py
View file @
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
,
)
# 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)
# max reduces by taking maximum along dim(s) or overall
# max reduces by taking maximum along dim(s) or overall
...
...
test/infinicore/ops/max_pool1d.py
View file @
61a7dc0e
...
@@ -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: (in_shape, in_strides_or_None, kernel_size, stride_or_None, padding, dilation, ceil_mode)
# Test cases format: (in_shape, in_strides_or_None, kernel_size, stride_or_None, padding, dilation, ceil_mode)
...
...
test/infinicore/ops/max_pool2d.py
View file @
61a7dc0e
...
@@ -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: (in_shape, in_strides_or_None, kernel_size, stride_or_None, padding, dilation, ceil_mode)
# Test cases format: (in_shape, in_strides_or_None, kernel_size, stride_or_None, padding, dilation, ceil_mode)
...
...
test/infinicore/ops/max_pool3d.py
View file @
61a7dc0e
...
@@ -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: (in_shape, in_strides_or_None, kernel_size, stride_or_None, padding, dilation, ceil_mode)
# Test cases format: (in_shape, in_strides_or_None, kernel_size, stride_or_None, padding, dilation, ceil_mode)
...
...
test/infinicore/ops/max_unpool1d.py
View file @
61a7dc0e
...
@@ -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
from
framework.tensor
import
TensorInitializer
from
framework.tensor
import
TensorInitializer
# Test cases format:
# Test cases format:
...
@@ -27,36 +26,34 @@ from framework.tensor import TensorInitializer
...
@@ -27,36 +26,34 @@ from framework.tensor import TensorInitializer
_TEST_CASES_DATA
=
[
_TEST_CASES_DATA
=
[
# ========== Basic cases ==========
# ========== Basic cases ==========
# small sizes and various stride/padding combinations
# small sizes and various stride/padding combinations
((
1
,
1
,
4
),
2
,
2
,
0
,
False
,
None
),
((
1
,
1
,
4
),
2
,
2
,
0
,
False
,
None
),
((
2
,
3
,
8
),
2
,
2
,
0
,
False
,
None
),
((
2
,
3
,
8
),
2
,
2
,
0
,
False
,
None
),
((
2
,
3
,
8
),
3
,
2
,
1
,
False
,
None
),
((
2
,
3
,
8
),
3
,
2
,
1
,
False
,
None
),
((
1
,
4
,
6
),
2
,
None
,
0
,
False
,
None
),
# default stride
((
1
,
4
,
6
),
2
,
None
,
0
,
False
,
None
),
# default stride
((
4
,
8
,
16
),
2
,
2
,
0
,
True
,
32
),
# L_in = (16-1)*2 - 0 + 2 = 32
((
4
,
8
,
16
),
2
,
2
,
0
,
True
,
32
),
# L_in = (16-1)*2 - 0 + 2 = 32
((
4
,
8
,
16
),
3
,
2
,
1
,
True
,
31
),
# L_in = (16-1)*2 - 2 + 3 = 31
((
4
,
8
,
16
),
3
,
2
,
1
,
True
,
31
),
# L_in = (16-1)*2 - 2 + 3 = 31
((
2
,
1
,
10
),
3
,
1
,
1
,
True
,
10
),
# L_in = (10-1)*1 - 2 + 3 = 10
((
2
,
1
,
10
),
3
,
1
,
1
,
True
,
10
),
# L_in = (10-1)*1 - 2 + 3 = 10
((
2
,
1
,
5
),
2
,
None
,
1
,
True
,
8
),
# L_in = (5-1)*2 - 2 + 2 = 8
((
2
,
1
,
5
),
2
,
None
,
1
,
True
,
8
),
# L_in = (5-1)*2 - 2 + 2 = 8
# ========== Large-scale performance test cases ==========
# ========== Large-scale performance test cases ==========
# medium to large sizes for performance and stability
# medium to large sizes for performance and stability
((
8
,
64
,
128
),
2
,
2
,
0
,
False
,
None
),
((
8
,
64
,
128
),
2
,
2
,
0
,
False
,
None
),
((
8
,
64
,
256
),
3
,
2
,
1
,
False
,
None
),
((
8
,
64
,
256
),
3
,
2
,
1
,
False
,
None
),
((
4
,
128
,
512
),
2
,
2
,
0
,
False
,
None
),
((
4
,
128
,
512
),
2
,
2
,
0
,
False
,
None
),
((
4
,
128
,
512
),
3
,
2
,
1
,
False
,
None
),
((
4
,
128
,
512
),
3
,
2
,
1
,
False
,
None
),
((
16
,
32
,
256
),
4
,
4
,
0
,
False
,
None
),
((
16
,
32
,
256
),
4
,
4
,
0
,
False
,
None
),
((
16
,
32
,
256
),
3
,
1
,
1
,
False
,
None
),
((
16
,
32
,
256
),
3
,
1
,
1
,
False
,
None
),
((
32
,
16
,
1024
),
2
,
2
,
0
,
True
,
2048
),
# L_in = (1024-1)*2 + 2 = 2048
((
32
,
16
,
1024
),
2
,
2
,
0
,
True
,
2048
),
# L_in = (1024-1)*2 + 2 = 2048
((
32
,
16
,
512
),
3
,
2
,
1
,
True
,
1023
),
# L_in = (512-1)*2 - 2 + 3 = 1023
((
32
,
16
,
512
),
3
,
2
,
1
,
True
,
1023
),
# L_in = (512-1)*2 - 2 + 3 = 1023
((
2
,
256
,
2048
),
2
,
2
,
0
,
True
,
4096
),
# L_in = (2048-1)*2 + 2 = 4096
((
2
,
256
,
2048
),
2
,
2
,
0
,
True
,
4096
),
# L_in = (2048-1)*2 + 2 = 4096
((
2
,
256
,
2048
),
3
,
2
,
1
,
True
,
4095
),
# L_in = (2048-1)*2 - 2 + 3 = 4095
((
2
,
256
,
2048
),
3
,
2
,
1
,
True
,
4095
),
# L_in = (2048-1)*2 - 2 + 3 = 4095
((
1
,
64
,
16384
),
2
,
2
,
0
,
False
,
None
),
((
1
,
64
,
16384
),
2
,
2
,
0
,
False
,
None
),
((
1
,
64
,
8192
),
3
,
2
,
1
,
False
,
None
),
((
1
,
64
,
8192
),
3
,
2
,
1
,
False
,
None
),
# ========== Edge cases ==========
# ========== Edge cases ==========
# extreme small / boundary sizes
# extreme small / boundary sizes
((
1
,
1
,
1
),
1
,
1
,
0
,
False
,
None
),
((
1
,
1
,
1
),
1
,
1
,
0
,
False
,
None
),
((
1
,
4
,
2
),
2
,
2
,
0
,
True
,
4
),
# L_in = (2-1)*2 + 2 = 4
((
1
,
4
,
2
),
2
,
2
,
0
,
True
,
4
),
# L_in = (2-1)*2 + 2 = 4
((
2
,
1
,
64
),
3
,
2
,
1
,
False
,
None
),
((
2
,
1
,
64
),
3
,
2
,
1
,
False
,
None
),
((
1
,
1
,
3
),
2
,
2
,
1
,
True
,
4
),
# L_in = (3-1)*2 - 2 + 2 = 4
((
1
,
1
,
3
),
2
,
2
,
1
,
True
,
4
),
# L_in = (3-1)*2 - 2 + 2 = 4
]
]
_TOLERANCE_MAP
=
{
_TOLERANCE_MAP
=
{
...
@@ -79,8 +76,14 @@ def parse_test_cases():
...
@@ -79,8 +76,14 @@ def parse_test_cases():
"""
"""
test_cases
=
[]
test_cases
=
[]
for
(
input_shape
,
kernel_size
,
stride
,
padding
,
for
(
use_output_size
,
output_length
)
in
_TEST_CASES_DATA
:
input_shape
,
kernel_size
,
stride
,
padding
,
use_output_size
,
output_length
,
)
in
_TEST_CASES_DATA
:
for
dtype
in
_TENSOR_DTYPES
:
for
dtype
in
_TENSOR_DTYPES
:
tol
=
_TOLERANCE_MAP
.
get
(
dtype
,
{
"atol"
:
1e-5
,
"rtol"
:
1e-4
})
tol
=
_TOLERANCE_MAP
.
get
(
dtype
,
{
"atol"
:
1e-5
,
"rtol"
:
1e-4
})
...
...
Prev
1
…
5
6
7
8
9
10
11
12
13
14
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment