Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
a383b22b
Unverified
Commit
a383b22b
authored
5 years ago
by
Robert Kimball
Committed by
GitHub
5 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3577 from NervanaSystems/gauri/new_reshape_error_master
Fix reshape error for onnx (on master)
parents
a15d2ec5
76e144d3
master
v0.29.0-rc.0
v0.28.0-rc.1
v0.28.0-rc.0
v0.27.1-rc.3
v0.27.1-rc.2
v0.27.1-rc.1
v0.27.1-rc.0
v0.27.0-rc.1
v0.27.0-rc.0
v0.26.1-rc.0
v0.26.0
v0.26.0-rc.8
v0.26.0-rc.7
v0.26.0-rc.6
v0.26.0-rc.5
v0.26.0-rc.4
v0.26.0-rc.3
v0.26.0-rc.2
v0.26.0-rc.0
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
squeeze.cpp
src/ngraph/op/fused/squeeze.cpp
+8
-6
result.hpp
src/ngraph/runtime/cpu/kernel/result.hpp
+1
-1
No files found.
src/ngraph/op/fused/squeeze.cpp
View file @
a383b22b
...
@@ -47,6 +47,7 @@ NodeVector op::Squeeze::decompose_op() const
...
@@ -47,6 +47,7 @@ NodeVector op::Squeeze::decompose_op() const
auto
axes
=
axes_constant
->
get_vector
<
size_t
>
();
auto
axes
=
axes_constant
->
get_vector
<
size_t
>
();
auto
data_shape
=
data
.
get_shape
();
auto
data_shape
=
data
.
get_shape
();
std
::
vector
<
uint64_t
>
axes_to_squeeze
(
data_shape
.
size
());
// Prepare set of unique axes marked to be removed from input data.
// Prepare set of unique axes marked to be removed from input data.
if
(
axes
.
empty
())
if
(
axes
.
empty
())
...
@@ -56,8 +57,11 @@ NodeVector op::Squeeze::decompose_op() const
...
@@ -56,8 +57,11 @@ NodeVector op::Squeeze::decompose_op() const
{
{
if
(
data_shape
.
at
(
idx
)
==
1
)
if
(
data_shape
.
at
(
idx
)
==
1
)
{
{
// Mark with zero elements to remove;
axes_to_squeeze
.
at
(
idx
)
=
1
;
data_shape
.
at
(
idx
)
=
0
;
}
else
{
axes_to_squeeze
.
at
(
idx
)
=
0
;
}
}
}
}
}
}
...
@@ -70,16 +74,14 @@ NodeVector op::Squeeze::decompose_op() const
...
@@ -70,16 +74,14 @@ NodeVector op::Squeeze::decompose_op() const
this
,
this
,
(
data_shape
.
at
(
axis
)
==
1
),
(
data_shape
.
at
(
axis
)
==
1
),
"provided axis value is invalid. Only axes of size 1 may be removed."
);
"provided axis value is invalid. Only axes of size 1 may be removed."
);
axes_to_squeeze
.
at
(
axis
)
=
1
;
// Mark with zero elements to remove;
data_shape
.
at
(
axis
)
=
0
;
}
}
}
}
Shape
output_data_shape
;
Shape
output_data_shape
;
for
(
size_t
idx
=
0
;
idx
<
data_shape
.
size
();
++
idx
)
for
(
size_t
idx
=
0
;
idx
<
data_shape
.
size
();
++
idx
)
{
{
if
(
data_shape
.
at
(
idx
)
!
=
0
)
if
(
axes_to_squeeze
.
at
(
idx
)
=
=
0
)
{
{
output_data_shape
.
push_back
(
data_shape
.
at
(
idx
));
output_data_shape
.
push_back
(
data_shape
.
at
(
idx
));
}
}
...
...
This diff is collapsed.
Click to expand it.
src/ngraph/runtime/cpu/kernel/result.hpp
View file @
a383b22b
...
@@ -30,7 +30,7 @@ namespace ngraph
...
@@ -30,7 +30,7 @@ namespace ngraph
template
<
typename
ElementType
>
template
<
typename
ElementType
>
void
result
(
const
void
*
arg
,
void
*
out
,
size_t
count
,
int
arena
)
void
result
(
const
void
*
arg
,
void
*
out
,
size_t
count
,
int
arena
)
{
{
if
(
arg
!=
out
)
if
(
arg
!=
out
&&
count
!=
0
)
{
{
memcpy
(
out
,
arg
,
sizeof
(
ElementType
)
*
count
);
memcpy
(
out
,
arg
,
sizeof
(
ElementType
)
*
count
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment