mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-06-24 02:14:17 +00:00
one less loop
This commit is contained in:
parent
5c2ac48c11
commit
bee89a4840
1 changed files with 3 additions and 4 deletions
|
|
@ -163,10 +163,9 @@ class Conv2D(Function):
|
|||
for X in range(ret.shape[3]):
|
||||
for j in range(H):
|
||||
for i in range(W):
|
||||
for c in range(cout):
|
||||
tx = x[:, :, Y+j, X+i]
|
||||
tw = w[c, :, j, i]
|
||||
ret[:, c, Y, X] += tx.dot(tw.reshape(-1, 1)).reshape(-1)
|
||||
tx = x[:, :, Y+j, X+i]
|
||||
tw = w[:, :, j, i]
|
||||
ret[:, :, Y, X] += tx.dot(tw.T)
|
||||
return ret
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue