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
6bd19ea9
Unverified
Commit
6bd19ea9
authored
Sep 15, 2018
by
Robert Kimball
Committed by
GitHub
Sep 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove contains_key() (#1613)
* remove contains_key() * fix logic error
parent
a517ba09
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
29 deletions
+5
-29
int_backend.cpp
src/ngraph/runtime/interpreter/int_backend.cpp
+3
-2
util.hpp
src/ngraph/util.hpp
+0
-25
graph_partition.cpp
test/graph_partition.cpp
+1
-1
test_control.cpp
test/util/test_control.cpp
+1
-1
No files found.
src/ngraph/runtime/interpreter/int_backend.cpp
View file @
6bd19ea9
...
...
@@ -153,7 +153,8 @@ bool runtime::interpreter::INTBackend::call(shared_ptr<Function> function,
{
descriptor
::
TensorView
*
tv
=
op
->
get_output_tensor_ptr
(
i
).
get
();
shared_ptr
<
runtime
::
HostTensorView
>
htv
;
if
(
!
contains_key
(
tensor_map
,
tv
))
auto
it
=
tensor_map
.
find
(
tv
);
if
(
it
==
tensor_map
.
end
())
{
// the output tensor is not in the tensor map so create a new tensor
const
Shape
&
shape
=
op
->
get_output_shape
(
i
);
...
...
@@ -164,7 +165,7 @@ bool runtime::interpreter::INTBackend::call(shared_ptr<Function> function,
}
else
{
htv
=
tensor_map
.
at
(
tv
)
;
htv
=
it
->
second
;
}
op_outputs
.
push_back
(
htv
);
}
...
...
src/ngraph/util.hpp
View file @
6bd19ea9
...
...
@@ -84,31 +84,6 @@ namespace ngraph
return
rc
;
}
template
<
typename
U
,
typename
T
>
bool
contains_key
(
const
U
&
container
,
const
T
&
obj
)
{
bool
rc
=
false
;
for
(
auto
o
:
container
)
{
if
(
o
.
first
==
obj
)
{
rc
=
true
;
break
;
}
}
return
rc
;
}
template
<
typename
U
,
typename
T
>
void
remove_from
(
U
&
container
,
const
T
&
obj
)
{
auto
it
=
container
.
find
(
obj
);
if
(
it
!=
container
.
end
())
{
container
.
erase
(
it
);
}
}
size_t
hash_combine
(
const
std
::
vector
<
size_t
>&
list
);
void
dump
(
std
::
ostream
&
out
,
const
void
*
,
size_t
);
...
...
test/graph_partition.cpp
View file @
6bd19ea9
...
...
@@ -73,7 +73,7 @@ public:
bool
compile
(
const
shared_ptr
<
Function
>&
func
)
{
if
(
!
contains_key
(
m_function_map
,
func
))
if
(
m_function_map
.
find
(
func
)
==
m_function_map
.
end
(
))
{
// Clone function
FunctionInstance
instance
;
...
...
test/util/test_control.cpp
View file @
6bd19ea9
...
...
@@ -48,7 +48,7 @@ string ngraph::prepend_disabled(const string& test_case_name,
}
}
}
if
(
contains
(
blacklist
,
test_name
))
if
(
blacklist
.
find
(
test_name
)
!=
blacklist
.
end
(
))
{
rc
=
"DISABLED_"
+
test_name
;
}
...
...
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