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
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
86 additions
and
51 deletions
+86
-51
test/infinicore/ops/cosine_embedding_loss.py
test/infinicore/ops/cosine_embedding_loss.py
+1
-2
test/infinicore/ops/cosine_similarity.py
test/infinicore/ops/cosine_similarity.py
+7
-3
test/infinicore/ops/count_nonzero.py
test/infinicore/ops/count_nonzero.py
+7
-3
test/infinicore/ops/cov.py
test/infinicore/ops/cov.py
+1
-2
test/infinicore/ops/cross.py
test/infinicore/ops/cross.py
+7
-3
test/infinicore/ops/cross_entropy.py
test/infinicore/ops/cross_entropy.py
+1
-2
test/infinicore/ops/cummax.py
test/infinicore/ops/cummax.py
+7
-3
test/infinicore/ops/cummin.py
test/infinicore/ops/cummin.py
+7
-3
test/infinicore/ops/cumprod.py
test/infinicore/ops/cumprod.py
+7
-3
test/infinicore/ops/cumsum.py
test/infinicore/ops/cumsum.py
+7
-3
test/infinicore/ops/deg2rad.py
test/infinicore/ops/deg2rad.py
+7
-3
test/infinicore/ops/det.py
test/infinicore/ops/det.py
+1
-2
test/infinicore/ops/diag.py
test/infinicore/ops/diag.py
+1
-2
test/infinicore/ops/diag_embed.py
test/infinicore/ops/diag_embed.py
+1
-2
test/infinicore/ops/diagflat.py
test/infinicore/ops/diagflat.py
+1
-2
test/infinicore/ops/diagonal.py
test/infinicore/ops/diagonal.py
+1
-2
test/infinicore/ops/diagonal_scatter.py
test/infinicore/ops/diagonal_scatter.py
+7
-3
test/infinicore/ops/diff.py
test/infinicore/ops/diff.py
+7
-3
test/infinicore/ops/digamma.py
test/infinicore/ops/digamma.py
+7
-3
test/infinicore/ops/dist.py
test/infinicore/ops/dist.py
+1
-2
No files found.
test/infinicore/ops/cosine_embedding_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: (input1_shape, input2_shape, target_shape, input1_strides_or_None, input2_strides_or_None, target_strides_or_None, margin_or_None)
# infinicore.nn.functional.cosine_embedding_loss(x1, x2, y, margin=0.0, reduction='mean')
...
...
test/infinicore/ops/cosine_similarity.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, dim, eps, a_strides_or_None, b_strides_or_None)
# infinicore.nn.functional.cosine_similarity(x1, x2, dim=1, eps=1e-8)
...
...
test/infinicore/ops/count_nonzero.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)
# count_nonzero counts number of non-zero elements along dims or overall
...
...
test/infinicore/ops/cov.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, correction, fweights, aweights)
_TEST_CASES_DATA
=
[
...
...
test/infinicore/ops/cross.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, dim, a_strides_or_None, b_strides_or_None)
# infinicore.cross(a, b, dim=-1)
...
...
test/infinicore/ops/cross_entropy.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
from
framework.tensor
import
TensorInitializer
# Test cases format: (input_shape_logits_N_C, target_shape_N, input_strides_or_None, weight_present_bool, ignore_index_or_None)
...
...
test/infinicore/ops/cummax.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, dim, input_strides_or_None, out_strides_or_None)
# cummax returns (values, indices). We will validate the values tensor using the
...
...
test/infinicore/ops/cummin.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, dim, input_strides_or_None, out_strides_or_None)
# cummin returns (values, indices). We validate values similar to cummax.
...
...
test/infinicore/ops/cumprod.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, dim, input_strides_or_None, out_strides_or_None)
# cumprod computes cumulative product along dim. PyTorch does not support explicit
...
...
test/infinicore/ops/cumsum.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, dim, input_strides_or_None, out_strides_or_None)
# cumsum supports out= in PyTorch? PyTorch provides infinicore.cumsum(input, dim, *, out=None)
...
...
test/infinicore/ops/deg2rad.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/det.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)
# det(input) — only out-of-place (no inplace/out parameter for det)
...
...
test/infinicore/ops/diag.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, diagonal_k_or_None)
# infinicore.diag: behavior depends on input dim: 1-D -> returns 2-D diag matrix; 2-D -> returns 1-D diagonal
...
...
test/infinicore/ops/diag_embed.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, offset_or_None)
# diag_embed(input, offset=0, dim1=-2, dim2=-1)
...
...
test/infinicore/ops/diagflat.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, offset_or_None)
# diagflat(input, offset=0, dim=0)
...
...
test/infinicore/ops/diagonal.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, offset_or_None, dim1_or_None, dim2_or_None)
# infinicore.diagonal(input, offset=0, dim1=0, dim2=1)
...
...
test/infinicore/ops/diagonal_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
,
)
# ===============================================================================
# Operator-specific configuration
...
...
test/infinicore/ops/diff.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, n, dim, input_strides_or_None)
...
...
test/infinicore/ops/digamma.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/dist.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: (shape, a_strides_or_None, b_strides_or_None, p_or_None)
# dist computes p-norm distance between two tensors
...
...
Prev
1
2
3
4
5
6
7
8
…
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