Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
429cca8e
MegEngine
项目概览
MegEngine 天元
/
MegEngine
1 年多 前同步成功
通知
403
Star
4705
Fork
582
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MegEngine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
429cca8e
编写于
5月 06, 2020
作者:
M
Megvii Engine Team
提交者:
Xinran Xu
5月 06, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs(mge/hub): refine docstring in hub module
GitOrigin-RevId: 2f73c1242b0c377c14cb05f2d24fe3ddbef9da27
上级
955095c1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
14 deletion
+15
-14
python_module/megengine/hub/fetcher.py
python_module/megengine/hub/fetcher.py
+6
-6
python_module/megengine/hub/hub.py
python_module/megengine/hub/hub.py
+6
-5
python_module/megengine/hub/tools.py
python_module/megengine/hub/tools.py
+3
-3
未找到文件。
python_module/megengine/hub/fetcher.py
浏览文件 @
429cca8e
...
...
@@ -102,17 +102,17 @@ class GitSSHFetcher(RepoFetcherBase):
silent
:
bool
=
True
,
)
->
str
:
"""
Fetch git repo by SSH protocol
Fetch
es
git repo by SSH protocol
:param git_host:
host address of git repo
d
xample: github.com
host address of git repo
.
e
xample: github.com
:param repo_info:
a string with format ``"repo_owner/repo_name[:tag_name/:branch_name]"`` with an optional
tag/branch. The default branch is ``master`` if not specified.
d
xample: ``"brain_sdk/MegBrain[:hub]"``
e
xample: ``"brain_sdk/MegBrain[:hub]"``
:param use_cache:
whether to use locally
ca
ched code or completely re-fetch
whether to use locally
fet
ched code or completely re-fetch
:param commit:
commit id on github or gitlab
:param silent:
...
...
@@ -215,7 +215,7 @@ class GitHTTPSFetcher(RepoFetcherBase):
silent
:
bool
=
True
,
)
->
str
:
"""
Fetch git repo by HTTPS protocol
Fetch
es
git repo by HTTPS protocol
:param git_host:
host address of git repo
...
...
python_module/megengine/hub/hub.py
浏览文件 @
429cca8e
...
...
@@ -94,7 +94,7 @@ def _init_hub(
commit
:
str
=
None
,
protocol
:
str
=
DEFAULT_PROTOCOL
,
):
"""Import hubmodule like python import
"""Import
s
hubmodule like python import
:param repo_info:
a string with format ``"repo_owner/repo_name[:tag_name/:branch_name]"`` with an optional
...
...
@@ -137,7 +137,7 @@ def list(
commit
:
str
=
None
,
protocol
:
str
=
DEFAULT_PROTOCOL
,
)
->
List
[
str
]:
"""List all entrypoints available in repo hubconf
"""List
s
all entrypoints available in repo hubconf
:param repo_info:
a string with format ``"repo_owner/repo_name[:tag_name/:branch_name]"`` with an optional
...
...
@@ -175,7 +175,7 @@ def load(
protocol
:
str
=
DEFAULT_PROTOCOL
,
**
kwargs
)
->
Any
:
"""Load model from github or gitlab repo, with pretrained weights.
"""Load
s
model from github or gitlab repo, with pretrained weights.
:param repo_info:
a string with format ``"repo_owner/repo_name[:tag_name/:branch_name]"`` with an optional
...
...
@@ -250,7 +250,7 @@ def help(
def
load_serialized_obj_from_url
(
url
:
str
,
model_dir
=
None
)
->
Any
:
"""Loads MegEngine serialized object
at
the given URL.
"""Loads MegEngine serialized object
from
the given URL.
If the object is already present in ``model_dir``, it's deserialized and
returned. If no ``model_dir`` is specified, it will be ``MGE_HOME/serialized``.
...
...
@@ -291,7 +291,8 @@ def load_serialized_obj_from_url(url: str, model_dir=None) -> Any:
class
pretrained
:
r
"""Decorator helps quick link model function to existing pretrained weights.
r
"""
Decorator which helps to download pretrained weights from the given url.
For example, we can decorate a resnet18 function as follows
...
...
python_module/megengine/hub/tools.py
浏览文件 @
429cca8e
...
...
@@ -15,7 +15,7 @@ from typing import Iterator
def
load_module
(
name
:
str
,
path
:
str
)
->
types
.
ModuleType
:
"""
Load module specified by name and path
Load
s
module specified by name and path
:param name: module name
:param path: module path
...
...
@@ -27,7 +27,7 @@ def load_module(name: str, path: str) -> types.ModuleType:
def
check_module_exists
(
module
:
str
)
->
bool
:
"""Check
python module exist
or not
"""Check
s whether python module exists
or not
:param module: name of module
"""
...
...
@@ -36,7 +36,7 @@ def check_module_exists(module: str) -> bool:
@
contextmanager
def
cd
(
target
:
str
)
->
Iterator
[
None
]:
"""Change current directory to target
"""Change
s
current directory to target
:param target: target directory
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录