Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
c3ba0280
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看板
提交
c3ba0280
编写于
1月 19, 2021
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore(mge): correct license headers
GitOrigin-RevId: 2dd4438f90b6ea19a213e316e068d0cc3372ad58
上级
364afec0
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
95 addition
and
19 deletion
+95
-19
imperative/src/impl/event_pool.cpp
imperative/src/impl/event_pool.cpp
+11
-0
imperative/src/impl/event_pool.h
imperative/src/impl/event_pool.h
+11
-0
imperative/src/impl/proxy_graph/common.h
imperative/src/impl/proxy_graph/common.h
+11
-0
imperative/src/impl/proxy_graph/mini_graph.h
imperative/src/impl/proxy_graph/mini_graph.h
+11
-0
imperative/src/impl/proxy_graph/proxy_graph.cpp
imperative/src/impl/proxy_graph/proxy_graph.cpp
+28
-11
imperative/src/impl/proxy_graph/proxy_graph_base.h
imperative/src/impl/proxy_graph/proxy_graph_base.h
+11
-0
imperative/src/impl/tensor_sanity_check.cpp
imperative/src/impl/tensor_sanity_check.cpp
+6
-4
imperative/src/include/megbrain/imperative/tensor_sanity_check.h
...ive/src/include/megbrain/imperative/tensor_sanity_check.h
+6
-4
未找到文件。
imperative/src/impl/event_pool.cpp
浏览文件 @
c3ba0280
/**
* \file imperative/src/impl/event_pool.cpp
* MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
*
* Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#include "./event_pool.h"
namespace
mgb
{
...
...
imperative/src/impl/event_pool.h
浏览文件 @
c3ba0280
/**
* \file imperative/src/impl/event_pool.h
* MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
*
* Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#pragma once
#include "megbrain/comp_node.h"
...
...
imperative/src/impl/proxy_graph/common.h
浏览文件 @
c3ba0280
/**
* \file imperative/src/impl/proxy_graph/common.h
* MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
*
* Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
namespace
mgb
::
imperative
::
proxy_graph
{
// a "namespace" struct to simplify friend declaration,
...
...
imperative/src/impl/proxy_graph/mini_graph.h
浏览文件 @
c3ba0280
/**
* \file imperative/src/impl/proxy_graph/mini_graph.h
* MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
*
* Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#include "megbrain/graph/operator_node.h"
#include "megbrain/imperative/physical_tensor.h"
#include "megbrain/imperative/op_def.h"
...
...
imperative/src/impl/proxy_graph/proxy_graph.cpp
浏览文件 @
c3ba0280
/**
* \file imperative/src/impl/proxy_graph/proxy_graph.cpp
* MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
*
* Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#include "./mini_graph.h"
// #include "../proxy_graph.h"
#if 0
// ../proxy_graph.h is deprecated, leave here for debug purpose
// uncomment #if 0 macro to debug
#include "../proxy_graph.h"
#endif
namespace
mgb
::
imperative
::
proxy_graph
{
MGB_DYN_TYPE_OBJ_FINAL_IMPL
(
ProxyGraph
::
InputPlaceholder
);
...
...
@@ -8,19 +23,21 @@ namespace mgb::imperative::proxy_graph {
}
// namespace mgb::imperative::proxy_graph
namespace
mgb
::
imperative
::
proxy_graph_detail
{
std
::
tuple
<
SmallVector
<
LogicalTensorDesc
>
,
bool
>
infer_output_attrs_fallible
(
const
OpDef
&
def
,
const
SmallVector
<
LogicalTensorDesc
>&
inputs
)
{
auto
ret
=
proxy_graph
::
ProxyGraphTypeI
::
inst
().
infer_output_attrs_fallible
(
def
,
inputs
);
// auto ref = ProxyGraph::get_default_graph()->infer_output_attrs_fallible(def, inputs);
// auto& [a, _1] = ret;
// auto& [b, _2] = ref;
// if (a.size() != b.size()) mgb_trap();
// for (size_t i = 0; i < a.size(); ++i) {
// if (a[i].layout.dtype != b[i].layout.dtype) mgb_trap();
// if (a[i].comp_node != b[i].comp_node) mgb_trap();
// if (!a[i].layout.eq_shape(b[i].layout)) mgb_trap();
// }
#if 0
// delete me after the new implementation is stable
auto ref = ProxyGraph::get_default_graph()->infer_output_attrs_fallible(def, inputs);
auto& [a, _1] = ret;
auto& [b, _2] = ref;
if (a.size() != b.size()) mgb_trap();
for (size_t i = 0; i < a.size(); ++i) {
if (a[i].layout.dtype != b[i].layout.dtype) mgb_trap();
if (a[i].comp_node != b[i].comp_node) mgb_trap();
if (!a[i].layout.eq_shape(b[i].layout)) mgb_trap();
}
#endif
return
ret
;
}
...
...
imperative/src/impl/proxy_graph/proxy_graph_base.h
浏览文件 @
c3ba0280
/**
* \file imperative/src/impl/proxy_graph/proxy_graph_base.h
* MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
*
* Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#include "megbrain/graph/cg.h"
namespace
mgb
::
imperative
::
proxy_graph
{
...
...
imperative/src/impl/tensor_sanity_check.cpp
浏览文件 @
c3ba0280
/**
* \file src/core/impl/imperative/tensor_sanity_check.cpp
* MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
*
* This file is part of MegBrain, a deep learning framework developed by Megvii.
*
* \copyright Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
* Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#include "megbrain/imperative/tensor_sanity_check.h"
...
...
@@ -127,4 +129,4 @@ std::string TensorSanityCheck::print_op(const OpDef& def){
}
}
// namespace imperative
}
// namespace mgb
\ No newline at end of file
}
// namespace mgb
imperative/src/include/megbrain/imperative/tensor_sanity_check.h
浏览文件 @
c3ba0280
/**
* \file src/core/include/megbrain/tensor_sanity_check.h
* MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
*
* This file is part of MegBrain, a deep learning framework developed by Megvii.
*
* \copyright Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
* Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
#include "megbrain/comp_node_env.h"
...
...
@@ -47,4 +49,4 @@ private:
}
// namespace imperative
}
// namespace mgb
\ No newline at end of file
}
// namespace mgb
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录