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
1cbad224
Unverified
Commit
1cbad224
authored
May 23, 2019
by
Adam Procter
Committed by
GitHub
May 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add environment variable to explicitly enable f->is_dynamic() (#2973)
parent
096ad6ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
graph_rewrite.cpp
src/ngraph/pass/graph_rewrite.cpp
+12
-4
No files found.
src/ngraph/pass/graph_rewrite.cpp
View file @
1cbad224
...
...
@@ -65,7 +65,11 @@ bool pass::GraphRewrite::run_on_function(shared_ptr<Function> f)
const
size_t
NUM_TRIES
=
10
;
size_t
tries
=
NUM_TRIES
;
vector
<
shared_ptr
<
pattern
::
Matcher
>>
original_matchers
{
m_matchers
};
bool
is_dynamic_function
=
f
->
is_dynamic
();
// This check is very expensive and is only needed for experimental features, so we will hide
// it behind an environment variable for now.
static
bool
s_rerun_dynamic_check
=
(
std
::
getenv
(
"NGRAPH_GRAPH_REWRITE_RERUN_DYNAMIC_CHECK"
)
!=
nullptr
);
bool
is_dynamic_function
=
s_rerun_dynamic_check
&&
f
->
is_dynamic
();
do
{
rewritten
=
false
;
...
...
@@ -92,7 +96,7 @@ bool pass::GraphRewrite::run_on_function(shared_ptr<Function> f)
if
(
matcher
->
process_match
())
{
rewritten
=
true
;
is_dynamic_function
=
f
->
is_dynamic
();
is_dynamic_function
=
s_rerun_dynamic_check
&&
f
->
is_dynamic
();
break
;
}
}
...
...
@@ -151,7 +155,11 @@ bool pass::RecurrentGraphRewrite::run_on_function(shared_ptr<Function> f)
{
bool
changed
=
false
;
size_t
i
=
0
;
bool
is_dynamic_function
=
f
->
is_dynamic
();
// This check is very expensive and is only needed for experimental features, so we will hide
// it behind an environment variable for now.
static
bool
s_rerun_dynamic_check
=
(
std
::
getenv
(
"NGRAPH_GRAPH_REWRITE_RERUN_DYNAMIC_CHECK"
)
!=
nullptr
);
bool
is_dynamic_function
=
s_rerun_dynamic_check
&&
f
->
is_dynamic
();
do
{
for
(
auto
node
:
f
->
get_ops
())
...
...
@@ -173,7 +181,7 @@ bool pass::RecurrentGraphRewrite::run_on_function(shared_ptr<Function> f)
if
(
matcher
->
process_match
())
{
changed
=
true
;
is_dynamic_function
=
f
->
is_dynamic
();
is_dynamic_function
=
s_rerun_dynamic_check
&&
f
->
is_dynamic
();
goto
next_fusion
;
}
}
...
...
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