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
99 additions
and
54 deletions
+99
-54
test/infinicore/ops/scatter.py
test/infinicore/ops/scatter.py
+7
-3
test/infinicore/ops/scatter_add.py
test/infinicore/ops/scatter_add.py
+7
-3
test/infinicore/ops/scatter_reduce.py
test/infinicore/ops/scatter_reduce.py
+7
-3
test/infinicore/ops/select_op.py
test/infinicore/ops/select_op.py
+1
-2
test/infinicore/ops/select_scatter.py
test/infinicore/ops/select_scatter.py
+7
-3
test/infinicore/ops/selu.py
test/infinicore/ops/selu.py
+7
-3
test/infinicore/ops/sgn.py
test/infinicore/ops/sgn.py
+1
-2
test/infinicore/ops/sign.py
test/infinicore/ops/sign.py
+1
-2
test/infinicore/ops/signbit.py
test/infinicore/ops/signbit.py
+1
-2
test/infinicore/ops/silu.py
test/infinicore/ops/silu.py
+8
-4
test/infinicore/ops/sinh.py
test/infinicore/ops/sinh.py
+7
-3
test/infinicore/ops/slice_scatter.py
test/infinicore/ops/slice_scatter.py
+7
-3
test/infinicore/ops/slogdet.py
test/infinicore/ops/slogdet.py
+1
-2
test/infinicore/ops/smooth_l1_loss.py
test/infinicore/ops/smooth_l1_loss.py
+1
-2
test/infinicore/ops/soft_margin_loss.py
test/infinicore/ops/soft_margin_loss.py
+1
-2
test/infinicore/ops/softmin.py
test/infinicore/ops/softmin.py
+7
-3
test/infinicore/ops/softplus.py
test/infinicore/ops/softplus.py
+7
-3
test/infinicore/ops/softshrink.py
test/infinicore/ops/softshrink.py
+7
-3
test/infinicore/ops/softsign.py
test/infinicore/ops/softsign.py
+7
-3
test/infinicore/ops/sort.py
test/infinicore/ops/sort.py
+7
-3
No files found.
test/infinicore/ops/scatter.py
View file @
61a7dc0e
...
...
@@ -5,10 +5,14 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework
import
(
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
,
is_broadcast
,
)
from
framework.tensor
import
TensorInitializer
from
framework.runner
import
GenericTestRunner
from
framework.utils
import
is_broadcast
# Test cases format: (input_shape, input_strides_or_None, dim, index_shape, src_shape)
_TEST_CASES_DATA
=
[
...
...
test/infinicore/ops/scatter_add.py
View file @
61a7dc0e
...
...
@@ -5,10 +5,14 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework
import
(
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
,
is_broadcast
,
)
from
framework.tensor
import
TensorInitializer
from
framework.runner
import
GenericTestRunner
from
framework.utils
import
is_broadcast
# Test cases format: (shape, input_strides, index_strides, src_strides, dim)
_TEST_CASES_DATA
=
[
...
...
test/infinicore/ops/scatter_reduce.py
View file @
61a7dc0e
...
...
@@ -5,10 +5,14 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework
import
(
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
,
is_broadcast
,
)
from
framework.tensor
import
TensorInitializer
from
framework.runner
import
GenericTestRunner
from
framework.utils
import
is_broadcast
# Test cases format: (shape, input_strides, index_strides, src_strides, dim, reduce)
_TEST_CASES_DATA
=
[
...
...
test/infinicore/ops/select_op.py
View file @
61a7dc0e
...
...
@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework
import
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
# Test cases format: (input_shape, input_strides_or_None, dim, index)
_TEST_CASES_DATA
=
[
...
...
test/infinicore/ops/select_scatter.py
View file @
61a7dc0e
...
...
@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework.utils
import
is_broadcast
from
framework
import
(
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
,
is_broadcast
,
)
from
framework.tensor
import
TensorInitializer
# Test cases format: (shape, input_strides, index_strides, src_strides, dim)
...
...
test/infinicore/ops/selu.py
View file @
61a7dc0e
...
...
@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework.utils
import
is_broadcast
from
framework
import
(
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
,
is_broadcast
,
)
# Test cases format: (in_shape, in_strides_or_None)
...
...
test/infinicore/ops/sgn.py
View file @
61a7dc0e
...
...
@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework
import
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
# Test cases format: (in_shape, in_strides_or_None)
# sgn is an alias for sign on many platforms; we provide similar coverage.
...
...
test/infinicore/ops/sign.py
View file @
61a7dc0e
...
...
@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework
import
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
# Test cases format: (in_shape, in_strides_or_None)
...
...
test/infinicore/ops/signbit.py
View file @
61a7dc0e
...
...
@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework
import
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
# Test cases format: (in_shape, in_strides_or_None)
# signbit returns boolean-like tensor; tolerances are exact.
...
...
test/infinicore/ops/silu.py
View file @
61a7dc0e
...
...
@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework.utils
import
is_broadcast
from
framework
import
(
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
,
is_broadcast
,
)
# ==============================================================================
# Operator-specific configuration
...
...
@@ -131,7 +135,7 @@ class OpTest(BaseOperatorTest):
def
infinicore_operator
(
self
,
input
,
out
=
None
,
**
kwargs
):
"""InfiniCore SiLU implementation"""
import
infinicore.nn.functional
as
F
return
F
.
silu
(
input
,
out
=
out
)
...
...
test/infinicore/ops/sinh.py
View file @
61a7dc0e
...
...
@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework.utils
import
is_broadcast
from
framework
import
(
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
,
is_broadcast
,
)
# =======================================================================
# Test cases format: (shape, input_strides_or_None)
...
...
test/infinicore/ops/slice_scatter.py
View file @
61a7dc0e
...
...
@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework.utils
import
is_broadcast
from
framework
import
(
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
,
is_broadcast
,
)
# # Test cases format: (shape, input_strides, src_strides, dim, start, end, step)
# _TEST_CASES_DATA = [
...
...
test/infinicore/ops/slogdet.py
View file @
61a7dc0e
...
...
@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework
import
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
# Test cases format: (matrix_shape, strides_or_None)
# slogdet(input) — returns (sign, logabsdet)
...
...
test/infinicore/ops/smooth_l1_loss.py
View file @
61a7dc0e
...
...
@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework
import
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
# Test cases format: (input_shape, target_shape, input_strides_or_None, beta_or_None, reduction_or_None)
# infinicore.nn.functional.smooth_l1_loss(input, target, reduction='mean', beta=1.0)
...
...
test/infinicore/ops/soft_margin_loss.py
View file @
61a7dc0e
...
...
@@ -5,8 +5,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework
import
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
# Test cases format: (input_shape, target_shape, input_strides_or_None, reduction_or_None)
# infinicore.nn.functional.soft_margin_loss(input, target, reduction='mean')
...
...
test/infinicore/ops/softmin.py
View file @
61a7dc0e
...
...
@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework.utils
import
is_broadcast
from
framework
import
(
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
,
is_broadcast
,
)
# Test cases format: (in_shape, in_strides_or_None, dim_or_None)
...
...
test/infinicore/ops/softplus.py
View file @
61a7dc0e
...
...
@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework.utils
import
is_broadcast
from
framework
import
(
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
,
is_broadcast
,
)
# Test cases format: (in_shape, in_strides_or_None, beta_or_None, threshold_or_None)
...
...
test/infinicore/ops/softshrink.py
View file @
61a7dc0e
...
...
@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework.utils
import
is_broadcast
from
framework
import
(
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
,
is_broadcast
,
)
# Test cases format: (in_shape, in_strides_or_None, lambd_or_None)
...
...
test/infinicore/ops/softsign.py
View file @
61a7dc0e
...
...
@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
from
framework.runner
import
GenericTestRunner
from
framework.utils
import
is_broadcast
from
framework
import
(
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
,
is_broadcast
,
)
# Test cases format: (in_shape, in_strides_or_None)
...
...
test/infinicore/ops/sort.py
View file @
61a7dc0e
...
...
@@ -5,9 +5,13 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import
torch
import
infinicore
from
framework.base
import
BaseOperatorTest
,
TensorSpec
,
TestCase
,
TestResult
from
framework.runner
import
GenericTestRunner
from
framework.utils
import
is_broadcast
from
framework
import
(
BaseOperatorTest
,
TensorSpec
,
TestCase
,
GenericTestRunner
,
is_broadcast
,
)
from
framework.devices
import
InfiniDeviceEnum
# ==============================================================================
...
...
Prev
1
…
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