This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
Repositories
Datasets
Forum
实训
竞赛
大数据
应用
Register
Sign In
OpenI
/
MegEngine
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
0
Code
Releases
31
Wiki
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
Browse Source
perf(functional/dropout): add fastpath for dropout
GitOrigin-RevId:
3bf8546908
tags/v1.6.0-rc1
Megvii Engine Team
3 years ago
parent
cc07b96f82
commit
77309609fa
1 changed files
with
2 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+2
-0
imperative/python/megengine/functional/nn.py
+ 2
- 0
imperative/python/megengine/functional/nn.py
View File
@@ -1304,6 +1304,8 @@ def dropout(inp: Tensor, drop_prob: float, training: bool = True) -> Tensor:
"""
assert 0 <= drop_prob < 1
if drop_prob == 0:
return inp
rv = uniform(size=inp.shape)
mask = rv > drop_prob
inp *= mask.astype(inp.dtype)
Write
Preview
Loading…
Cancel
Save