Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
as350144
Mace
提交
e3357e41
Mace
项目概览
as350144
/
Mace
与 Fork 源项目一致
Fork自
Xiaomi / Mace
通知
2
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Mace
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e3357e41
编写于
3月 06, 2018
作者:
李
李寅
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do nothing when resize image
上级
97603f1e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
9 deletion
+10
-9
mace/core/runtime/hexagon/hexagon_control_wrapper.cc
mace/core/runtime/hexagon/hexagon_control_wrapper.cc
+0
-1
mace/core/tensor.h
mace/core/tensor.h
+10
-8
未找到文件。
mace/core/runtime/hexagon/hexagon_control_wrapper.cc
浏览文件 @
e3357e41
...
@@ -62,7 +62,6 @@ bool HexagonControlWrapper::SetupGraph(const NetDef &net_def) {
...
@@ -62,7 +62,6 @@ bool HexagonControlWrapper::SetupGraph(const NetDef &net_def) {
// const node
// const node
std
::
thread
const_thread
([
&
]()
{
std
::
thread
const_thread
([
&
]()
{
std
::
cout
<<
"thread function
\n
"
;
std
::
vector
<
hexagon_nn_const_node
>
const_node_list
;
std
::
vector
<
hexagon_nn_const_node
>
const_node_list
;
for
(
const
ConstTensor
&
const_tensor
:
net_def
.
tensors
())
{
for
(
const
ConstTensor
&
const_tensor
:
net_def
.
tensors
())
{
std
::
vector
<
int
>
tensor_shape
(
const_tensor
.
dims
().
begin
(),
std
::
vector
<
int
>
tensor_shape
(
const_tensor
.
dims
().
begin
(),
...
...
mace/core/tensor.h
浏览文件 @
e3357e41
...
@@ -169,6 +169,7 @@ class Tensor {
...
@@ -169,6 +169,7 @@ class Tensor {
inline
void
Resize
(
const
std
::
vector
<
index_t
>
&
shape
)
{
inline
void
Resize
(
const
std
::
vector
<
index_t
>
&
shape
)
{
shape_
=
shape
;
shape_
=
shape
;
image_shape_
.
clear
();
if
(
buffer_
!=
nullptr
)
{
if
(
buffer_
!=
nullptr
)
{
MACE_CHECK
(
!
has_opencl_image
(),
"Cannot resize image, use ResizeImage."
);
MACE_CHECK
(
!
has_opencl_image
(),
"Cannot resize image, use ResizeImage."
);
buffer_
->
Resize
(
raw_size
());
buffer_
->
Resize
(
raw_size
());
...
@@ -181,24 +182,25 @@ class Tensor {
...
@@ -181,24 +182,25 @@ class Tensor {
inline
void
ResizeImage
(
const
std
::
vector
<
index_t
>
&
shape
,
inline
void
ResizeImage
(
const
std
::
vector
<
index_t
>
&
shape
,
const
std
::
vector
<
size_t
>
&
image_shape
)
{
const
std
::
vector
<
size_t
>
&
image_shape
)
{
shape_
=
shape
;
shape_
=
shape
;
image_shape_
=
image_shape
;
if
(
buffer_
==
nullptr
)
{
if
(
buffer_
==
nullptr
)
{
buffer_
=
new
Image
(
image_shape
,
dtype_
);
buffer_
=
new
Image
(
image_shape
,
dtype_
);
is_buffer_owner_
=
true
;
is_buffer_owner_
=
true
;
}
else
{
}
else
{
MACE_CHECK
(
has_opencl_image
(),
"Cannot ResizeImage buffer, use Resize."
);
MACE_CHECK
(
has_opencl_image
(),
"Cannot ResizeImage buffer, use Resize."
);
Image
*
image
=
dynamic_cast
<
Image
*>
(
buffer_
);
Image
*
image
=
dynamic_cast
<
Image
*>
(
buffer_
);
MACE_CHECK
(
shape
[
0
]
<=
image
->
image_shape
()[
0
]
MACE_CHECK
(
image_
shape
[
0
]
<=
image
->
image_shape
()[
0
]
&&
shape
[
1
]
<=
image
->
image_shape
()[
1
],
&&
image_
shape
[
1
]
<=
image
->
image_shape
()[
1
],
"tensor (source op "
,
"tensor (source op "
,
name_
,
name_
,
"): current image shape: "
,
"): current
physical
image shape: "
,
image
->
image_shape
()[
0
],
image
->
image_shape
()[
0
],
", "
,
", "
,
image
->
image_shape
()[
1
],
image
->
image_shape
()[
1
],
" <
resize tensor
shape: "
,
" <
logical image
shape: "
,
shape
[
0
],
image_
shape
[
0
],
", "
,
", "
,
shape
[
1
]);
image_
shape
[
1
]);
}
}
}
}
...
@@ -212,8 +214,7 @@ class Tensor {
...
@@ -212,8 +214,7 @@ class Tensor {
delete
buffer_
;
delete
buffer_
;
buffer_
=
nullptr
;
buffer_
=
nullptr
;
}
}
ResizeImage
(
other
->
shape
(),
ResizeImage
(
other
->
shape
(),
other
->
image_shape_
);
dynamic_cast
<
Image
*>
(
other
->
UnderlyingBuffer
())
->
image_shape
());
}
else
{
}
else
{
if
(
is_buffer_owner_
&&
buffer_
!=
nullptr
&&
has_opencl_image
())
{
if
(
is_buffer_owner_
&&
buffer_
!=
nullptr
&&
has_opencl_image
())
{
delete
buffer_
;
delete
buffer_
;
...
@@ -307,6 +308,7 @@ class Tensor {
...
@@ -307,6 +308,7 @@ class Tensor {
Allocator
*
allocator_
;
Allocator
*
allocator_
;
DataType
dtype_
;
DataType
dtype_
;
std
::
vector
<
index_t
>
shape_
;
std
::
vector
<
index_t
>
shape_
;
std
::
vector
<
size_t
>
image_shape_
;
BufferBase
*
buffer_
;
BufferBase
*
buffer_
;
BufferSlice
buffer_slice_
;
BufferSlice
buffer_slice_
;
bool
is_buffer_owner_
;
bool
is_buffer_owner_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录