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
776010d3
Commit
776010d3
authored
Jun 06, 2025
by
Catheriany
Browse files
issue/228: 更新测试
parent
aeeae7ea
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
15 deletions
+12
-15
src/infiniop-test/src/ops/clip.cpp
src/infiniop-test/src/ops/clip.cpp
+1
-1
src/infiniop-test/src/ops/random_sample.cpp
src/infiniop-test/src/ops/random_sample.cpp
+1
-1
test/infiniop-test/test_generate/infiniop_test.py
test/infiniop-test/test_generate/infiniop_test.py
+6
-11
test/infiniop-test/test_generate/testcases/add.py
test/infiniop-test/test_generate/testcases/add.py
+2
-1
test/infiniop-test/test_generate/testcases/swiglu.py
test/infiniop-test/test_generate/testcases/swiglu.py
+2
-1
No files found.
src/infiniop-test/src/ops/clip.cpp
View file @
776010d3
...
...
@@ -98,7 +98,7 @@ std::vector<std::string> Test::tensor_names() {
}
std
::
vector
<
std
::
string
>
Test
::
output_names
()
{
return
{
"y"
};
return
{};
}
std
::
string
Test
::
toString
()
const
{
...
...
src/infiniop-test/src/ops/random_sample.cpp
View file @
776010d3
...
...
@@ -110,7 +110,7 @@ std::vector<std::string> Test::tensor_names() {
}
std
::
vector
<
std
::
string
>
Test
::
output_names
()
{
return
{
"result"
};
return
{};
}
std
::
string
Test
::
toString
()
const
{
...
...
test/infiniop-test/test_generate/infiniop_test.py
View file @
776010d3
...
...
@@ -37,18 +37,13 @@ def contiguous_gguf_strides(shape: tuple[int, ...]) -> list[int]:
acc
*=
size
return
strides
[::
-
1
]
def
process_zero_stride_tensor
(
a
,
b
,
stride_a
=
None
,
stride_b
=
None
):
def
normalize_stride
(
tensor
,
stride
):
def
process_zero_stride_tensor
(
tensor
,
stride
=
None
):
if
stride
:
slices
=
tuple
(
slice
(
0
,
1
)
if
s
==
0
else
slice
(
None
)
for
s
in
stride
)
return
tensor
[
slices
]
else
:
return
tensor
a_unique
=
normalize_stride
(
a
,
stride_a
)
b_unique
=
normalize_stride
(
b
,
stride_b
)
return
a_unique
,
b_unique
class
InfiniopTestCase
:
op_name
:
str
...
...
test/infiniop-test/test_generate/testcases/add.py
View file @
776010d3
...
...
@@ -100,7 +100,8 @@ if __name__ == "__main__":
a
=
np
.
random
.
rand
(
*
shape
).
astype
(
dtype
)
b
=
np
.
random
.
rand
(
*
shape
).
astype
(
dtype
)
c
=
np
.
empty
(
tuple
(
0
for
_
in
shape
),
dtype
=
dtype
)
a
,
b
=
process_zero_stride_tensor
(
a
,
b
,
stride_a
,
stride_b
)
a
=
process_zero_stride_tensor
(
a
,
stride_a
)
b
=
process_zero_stride_tensor
(
b
,
stride_b
)
test_case
=
AddTestCase
(
a
=
a
,
shape_a
=
shape
,
...
...
test/infiniop-test/test_generate/testcases/swiglu.py
View file @
776010d3
...
...
@@ -102,7 +102,8 @@ if __name__ == "__main__":
a
=
np
.
random
.
rand
(
*
shape
).
astype
(
dtype
)
b
=
np
.
random
.
rand
(
*
shape
).
astype
(
dtype
)
c
=
np
.
empty
(
tuple
(
0
for
_
in
shape
),
dtype
=
dtype
)
a
,
b
=
process_zero_stride_tensor
(
a
,
b
,
stride_a
,
stride_b
)
a
=
process_zero_stride_tensor
(
a
,
stride_a
)
b
=
process_zero_stride_tensor
(
b
,
stride_b
)
test_case
=
SwiGLUTestCase
(
a
=
a
,
shape_a
=
list
(
shape
),
...
...
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