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
ox696c
ktransformers
Commits
77c6cc82
Unverified
Commit
77c6cc82
authored
Apr 07, 2025
by
Azure
Committed by
GitHub
Apr 07, 2025
Browse files
Merge pull request #1063 from aubreyli/KLinearCPUInfer.forward-fix
Fix TypeError when invoke KLinearCPUInfer.forward()
parents
6463070b
12a4c631
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
ktransformers/operators/linear.py
ktransformers/operators/linear.py
+1
-1
No files found.
ktransformers/operators/linear.py
View file @
77c6cc82
...
@@ -699,7 +699,7 @@ class KLinearCPUInfer(KLinearBase):
...
@@ -699,7 +699,7 @@ class KLinearCPUInfer(KLinearBase):
self
.
group_max_len
=
group_max_len
self
.
group_max_len
=
group_max_len
self
.
out_device
=
out_device
self
.
out_device
=
out_device
def
forward
(
self
,
x
:
torch
.
Tensor
)
->
torch
.
Tensor
:
def
forward
(
self
,
x
:
torch
.
Tensor
,
bsz_tensor
:
torch
.
Tensor
=
None
)
->
torch
.
Tensor
:
origin_shape
=
x
.
shape
# [batch_size, q_len, hidden_size]
origin_shape
=
x
.
shape
# [batch_size, q_len, hidden_size]
if
origin_shape
[
1
]
==
1
and
torch
.
cuda
.
is_current_stream_capturing
():
if
origin_shape
[
1
]
==
1
and
torch
.
cuda
.
is_current_stream_capturing
():
out_device
=
x
.
device
out_device
=
x
.
device
...
...
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