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
docs(mge/functional): fix doctest
GitOrigin-RevId:
cd23860ab8
tags/v0.4.0
Megvii Engine Team
Xinran Xu
5 years ago
parent
4500faf1ea
commit
8659876794
1 changed files
with
1 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
python_module/megengine/functional/nn.py
+ 1
- 1
python_module/megengine/functional/nn.py
View File
@@ -443,7 +443,7 @@ def one_hot(inp: Tensor, num_classes: int) -> Tensor:
import megengine.functional as F
inp = tensor(np.arange(1, 4, dtype=np.int32))
out = F.one_hot(inp)
out = F.one_hot(inp
, num_classes=4
)
print(out.numpy())
Outputs:
Write
Preview
Loading…
Cancel
Save