mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-24 06:18:01 -05:00
oops, don't assign self
This commit is contained in:
@@ -317,8 +317,8 @@ class Tensor:
|
||||
return y.div((y*y).mean(axis=axis, keepdim=True).add(eps).sqrt())
|
||||
|
||||
def batchnorm(self, weight:Tensor, bias:Tensor, mean:Tensor, invstd:Tensor):
|
||||
self = (self - mean.reshape(shape=[1, -1, 1, 1])) * weight.reshape(shape=[1, -1, 1, 1])
|
||||
return self.mul(invstd.reshape(shape=[1, -1, 1, 1])) + bias.reshape(shape=[1, -1, 1, 1])
|
||||
x = (self - mean.reshape(shape=[1, -1, 1, 1])) * weight.reshape(shape=[1, -1, 1, 1])
|
||||
return x.mul(invstd.reshape(shape=[1, -1, 1, 1])) + bias.reshape(shape=[1, -1, 1, 1])
|
||||
|
||||
# An instantiation of the Function is the Context
|
||||
class Function:
|
||||
|
||||
Reference in New Issue
Block a user