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
OpenDAS
ollama
Commits
0d140bd1
Unverified
Commit
0d140bd1
authored
Oct 29, 2025
by
Michael Yang
Committed by
GitHub
Oct 29, 2025
Browse files
fix: conv2d bias (#12834)
parent
93e45f0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
ml/nn/convolution.go
ml/nn/convolution.go
+2
-1
No files found.
ml/nn/convolution.go
View file @
0d140bd1
...
@@ -10,7 +10,8 @@ type Conv2D struct {
...
@@ -10,7 +10,8 @@ type Conv2D struct {
func
(
m
*
Conv2D
)
Forward
(
ctx
ml
.
Context
,
t
ml
.
Tensor
,
s0
,
s1
,
p0
,
p1
,
d0
,
d1
int
)
ml
.
Tensor
{
func
(
m
*
Conv2D
)
Forward
(
ctx
ml
.
Context
,
t
ml
.
Tensor
,
s0
,
s1
,
p0
,
p1
,
d0
,
d1
int
)
ml
.
Tensor
{
t
=
m
.
Weight
.
Conv2D
(
ctx
,
t
,
s0
,
s1
,
p0
,
p1
,
d0
,
d1
)
t
=
m
.
Weight
.
Conv2D
(
ctx
,
t
,
s0
,
s1
,
p0
,
p1
,
d0
,
d1
)
if
m
.
Bias
!=
nil
{
if
m
.
Bias
!=
nil
{
t
=
t
.
Add
(
ctx
,
m
.
Bias
)
// Bias shape is (out_channels,) while t shape is (width, height, out_channels, batch)
t
=
t
.
Add
(
ctx
,
m
.
Bias
.
Reshape
(
ctx
,
1
,
1
,
-
1
))
}
}
return
t
return
t
}
}
...
...
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