forked from tinygrad/tinygrad
argfix axis
This commit is contained in:
+1
-1
@@ -928,7 +928,7 @@ class Tensor:
|
||||
shape = tuple(s if ax in argfix(axis) else 1 for ax, s in enumerate(self.shape))
|
||||
x = self - mean.reshape(shape)
|
||||
if weight: x = x * weight.reshape(shape)
|
||||
ret = x.mul(invstd.reshape(shape) if len(invstd.shape) == len(axis) else invstd)
|
||||
ret = x.mul(invstd.reshape(shape) if len(invstd.shape) == len(argfix(axis)) else invstd)
|
||||
return (ret + bias.reshape(shape)) if bias else ret
|
||||
|
||||
def dropout(self, p=0.5) -> Tensor:
|
||||
|
||||
Reference in New Issue
Block a user