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
10195034
Commit
10195034
authored
Dec 18, 2019
by
baojun
Committed by
Scott Cyphers
Dec 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve shape prop issue (#4080)
* use pre_validate function * use pre_validate
parent
2cbe42c8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
33 deletions
+16
-33
layout_converter.cpp
src/ngraph/frontend/fluid/operators/layout_converter.cpp
+2
-5
layout_converter.hpp
src/ngraph/frontend/fluid/operators/layout_converter.hpp
+1
-1
pool.cpp
src/ngraph/frontend/fluid/operators/pool.cpp
+3
-11
pool.hpp
src/ngraph/frontend/fluid/operators/pool.hpp
+2
-2
reduce_sum.cpp
src/ngraph/frontend/fluid/operators/reduce_sum.cpp
+6
-12
reduce_sum.hpp
src/ngraph/frontend/fluid/operators/reduce_sum.hpp
+2
-2
No files found.
src/ngraph/frontend/fluid/operators/layout_converter.cpp
View file @
10195034
...
...
@@ -63,15 +63,12 @@ shared_ptr<Node> LayoutConverter::copy_with_new_args(const NodeVector& new_args)
return
make_shared
<
LayoutConverter
>
(
new_args
.
at
(
0
),
get_mode
());
}
void
LayoutConverter
::
validate_and_infer_types
()
void
LayoutConverter
::
pre_
validate_and_infer_types
()
{
auto
shape
=
get_input_partial_shape
(
0
);
if
(
shape
.
is_dynamic
())
{
set_output_type
(
0
,
get_input_element_type
(
0
),
PartialShape
::
dynamic
());
}
else
{
FusedOp
::
validate_and_infer_types
();
}
}
src/ngraph/frontend/fluid/operators/layout_converter.hpp
View file @
10195034
...
...
@@ -42,7 +42,7 @@ namespace ngraph
virtual
NodeVector
decompose_op
()
const
override
;
virtual
void
validate_and_infer_types
()
override
;
virtual
void
pre_
validate_and_infer_types
()
override
;
virtual
std
::
shared_ptr
<
Node
>
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
override
;
...
...
src/ngraph/frontend/fluid/operators/pool.cpp
View file @
10195034
...
...
@@ -125,17 +125,14 @@ shared_ptr<Node> Pool::copy_with_new_args(const NodeVector& new_args) const
get_pooling_type
());
}
void
Pool
::
validate_and_infer_types
()
void
Pool
::
pre_
validate_and_infer_types
()
{
auto
shape
=
get_input_partial_shape
(
0
);
if
(
shape
.
is_dynamic
())
{
set_output_type
(
0
,
get_input_element_type
(
0
),
PartialShape
::
dynamic
());
}
else
{
FusedOp
::
validate_and_infer_types
();
}
}
constexpr
NodeTypeInfo
PoolGrad
::
type_info
;
...
...
@@ -162,18 +159,13 @@ PoolGrad::PoolGrad(const Output<Node>& x,
constructor_validate_and_infer_types
();
}
void
PoolGrad
::
validate_and_infer_types
()
void
PoolGrad
::
pre_
validate_and_infer_types
()
{
auto
shape
=
get_input_partial_shape
(
0
);
if
(
get_input_partial_shape
(
0
).
is_dynamic
()
||
get_input_partial_shape
(
1
).
is_dynamic
()
||
get_input_partial_shape
(
2
).
is_dynamic
())
{
set_output_type
(
0
,
get_input_element_type
(
0
),
PartialShape
::
dynamic
());
}
else
{
FusedOp
::
validate_and_infer_types
();
}
}
shared_ptr
<
Node
>
PoolGrad
::
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
...
...
src/ngraph/frontend/fluid/operators/pool.hpp
View file @
10195034
...
...
@@ -49,7 +49,7 @@ namespace ngraph
virtual
NodeVector
decompose_op
()
const
override
;
virtual
void
validate_and_infer_types
()
override
;
virtual
void
pre_
validate_and_infer_types
()
override
;
virtual
std
::
shared_ptr
<
Node
>
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
override
;
...
...
@@ -103,7 +103,7 @@ namespace ngraph
virtual
NodeVector
decompose_op
()
const
override
;
virtual
void
validate_and_infer_types
()
override
;
virtual
void
pre_
validate_and_infer_types
()
override
;
virtual
std
::
shared_ptr
<
Node
>
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
override
;
...
...
src/ngraph/frontend/fluid/operators/reduce_sum.cpp
View file @
10195034
...
...
@@ -71,16 +71,13 @@ NodeVector ReduceSum::decompose_op() const
return
retval
;
}
void
ReduceSum
::
validate_and_infer_types
()
void
ReduceSum
::
pre_
validate_and_infer_types
()
{
auto
shape
=
get_input_partial_shape
(
0
);
if
(
shape
.
is_dynamic
())
{
set_output_type
(
0
,
get_input_element_type
(
0
),
get_input_partial_shape
(
0
));
}
else
{
FusedOp
::
validate_and_infer_types
();
set_output_type
(
0
,
get_input_element_type
(
0
),
PartialShape
::
dynamic
());
}
}
...
...
@@ -161,16 +158,13 @@ NodeVector ReduceSumGrad::decompose_op() const
return
retval
;
}
void
ReduceSumGrad
::
validate_and_infer_types
()
void
ReduceSumGrad
::
pre_
validate_and_infer_types
()
{
auto
shape
=
get_input_partial_shape
(
0
);
if
(
shape
.
is_dynamic
())
{
set_output_type
(
0
,
get_input_element_type
(
0
),
get_input_partial_shape
(
0
));
}
else
{
FusedOp
::
validate_and_infer_types
();
set_output_type
(
0
,
get_input_element_type
(
0
),
PartialShape
::
dynamic
());
}
}
...
...
src/ngraph/frontend/fluid/operators/reduce_sum.hpp
View file @
10195034
...
...
@@ -44,7 +44,7 @@ namespace ngraph
virtual
NodeVector
decompose_op
()
const
override
;
virtual
void
validate_and_infer_types
()
override
;
virtual
void
pre_
validate_and_infer_types
()
override
;
virtual
std
::
shared_ptr
<
Node
>
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
override
;
...
...
@@ -75,7 +75,7 @@ namespace ngraph
virtual
NodeVector
decompose_op
()
const
override
;
virtual
void
validate_and_infer_types
()
override
;
virtual
void
pre_
validate_and_infer_types
()
override
;
virtual
std
::
shared_ptr
<
Node
>
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
override
;
...
...
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