Merge branch 'master' of github.com:514flowey/jittor

This commit is contained in:
514flowey 2024-12-16 22:20:20 +08:00
commit eefd57c0f4
3 changed files with 4 additions and 1 deletions

View File

@ -9,7 +9,7 @@
# file 'LICENSE.txt', which is part of this source code package.
# ***************************************************************
__version__ = '1.3.9.11'
__version__ = '1.3.9.12'
from jittor_utils import lock
with lock.lock_scope():
ori_int = int

View File

@ -347,6 +347,8 @@ def stack(x, dim=0):
[[4 5 6]]]
'''
assert isinstance(x, Sequence)
if isinstance(x, tuple):
x = list(x)
for i,x_ in enumerate(x):
x[i] = jt.array(x_)
if len(x) < 2:

View File

@ -572,6 +572,7 @@ class Dropout(Module):
noise = jt.random(input.shape)
noise = (noise > self.p).int()
output = output * noise / (1.0 - self.p) # div keep prob
output = output.to(input.dtype)
return output
def dropout(x,p=0.5,is_train=False):