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
fix(pylite): add dtype to empty tensor to_numpy api
GitOrigin-RevId:
4f61e5b544
tags/v1.7.0.m1
Megvii Engine Team
3 years ago
parent
02d5f46d90
commit
8f2e2711ea
1 changed files
with
2 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+2
-1
lite/pylite/megenginelite/tensor.py
+ 2
- 1
lite/pylite/megenginelite/tensor.py
View File
@@ -421,7 +421,8 @@ class LiteTensor(object):
"""
self.update()
if self.nbytes <= 0:
return np.array([])
np_type = _lite_type_to_nptypes[LiteDataType(self._layout.data_type)]
return np.array([], dtype=np_type)
if self.is_continue and (
self.is_pinned_host or self.device_type == LiteDeviceType.LITE_CPU
):
Write
Preview
Loading…
Cancel
Save