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
82c405ea
Commit
82c405ea
authored
Oct 08, 2017
by
Robert Kimball
Committed by
Adam Procter
Oct 08, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete Input and Output copy constructors (#182)
parent
6f38615d
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
23 deletions
+23
-23
input.hpp
src/ngraph/descriptor/input.hpp
+3
-3
output.hpp
src/ngraph/descriptor/output.hpp
+5
-5
node.hpp
src/ngraph/node.hpp
+6
-6
liveness.cpp
src/ngraph/pass/liveness.cpp
+2
-2
input_output_assign.cpp
test/input_output_assign.cpp
+4
-4
tensor.cpp
test/tensor.cpp
+3
-3
No files found.
src/ngraph/descriptor/input.hpp
View file @
82c405ea
...
...
@@ -60,9 +60,9 @@ namespace ngraph
Output
&
m_output
;
private
:
// Input(const Input&) = default
;
// Input(Input&&) = default
;
//
Input& operator=(const Input&) = delete;
Input
(
const
Input
&
)
=
delete
;
Input
(
Input
&&
)
=
delete
;
Input
&
operator
=
(
const
Input
&
)
=
delete
;
};
}
}
src/ngraph/descriptor/output.hpp
View file @
82c405ea
...
...
@@ -27,11 +27,6 @@ namespace ngraph
// Describes an output tensor of an op
class
Output
{
// For some odd reason emplace_back is requiring a copy constructor
// it should not. See issue #111 for details
// Output(const Output&) = delete;
// Output& operator=(const Output&) = delete;
public
:
/// @param node Node that owns this output.
/// @param index Position of the output tensor in all output tensors
...
...
@@ -53,6 +48,11 @@ namespace ngraph
size_t
m_index
;
std
::
shared_ptr
<
TensorView
>
m_tensor_view
;
std
::
set
<
Input
*>
m_inputs
;
private
:
Output
(
const
Output
&
)
=
delete
;
Output
(
Output
&&
)
=
delete
;
Output
&
operator
=
(
const
Output
&
)
=
delete
;
};
}
}
src/ngraph/node.hpp
View file @
82c405ea
...
...
@@ -99,10 +99,10 @@ namespace ngraph
size_t
get_instance_id
()
const
{
return
m_instance_id
;
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
,
const
Node
&
);
std
::
vector
<
descriptor
::
Input
>&
get_inputs
()
{
return
m_inputs
;
}
const
std
::
vector
<
descriptor
::
Input
>&
get_inputs
()
const
{
return
m_inputs
;
}
std
::
vector
<
descriptor
::
Output
>&
get_outputs
()
{
return
m_outputs
;
}
const
std
::
vector
<
descriptor
::
Output
>&
get_outputs
()
const
{
return
m_outputs
;
}
std
::
deque
<
descriptor
::
Input
>&
get_inputs
()
{
return
m_inputs
;
}
const
std
::
deque
<
descriptor
::
Input
>&
get_inputs
()
const
{
return
m_inputs
;
}
std
::
deque
<
descriptor
::
Output
>&
get_outputs
()
{
return
m_outputs
;
}
const
std
::
deque
<
descriptor
::
Output
>&
get_outputs
()
const
{
return
m_outputs
;
}
std
::
unordered_set
<
descriptor
::
Tensor
*>
liveness_live_list
;
std
::
unordered_set
<
descriptor
::
Tensor
*>
liveness_new_list
;
std
::
unordered_set
<
descriptor
::
Tensor
*>
liveness_free_list
;
...
...
@@ -114,8 +114,8 @@ namespace ngraph
std
::
string
m_name
;
size_t
m_instance_id
;
static
size_t
m_next_instance_id
;
std
::
vector
<
descriptor
::
Input
>
m_inputs
;
std
::
vector
<
descriptor
::
Output
>
m_outputs
;
std
::
deque
<
descriptor
::
Input
>
m_inputs
;
std
::
deque
<
descriptor
::
Output
>
m_outputs
;
bool
m_is_output
;
};
}
src/ngraph/pass/liveness.cpp
View file @
82c405ea
...
...
@@ -39,7 +39,7 @@ bool pass::Liveness::run_on_call_graph(list<Node*>& ops)
node
->
liveness_new_list
.
clear
();
node
->
liveness_free_list
.
clear
();
unordered_set
<
Tensor
*>
input_tensor_decls
;
for
(
auto
input_decl
:
node
->
get_inputs
())
for
(
Input
&
input_decl
:
node
->
get_inputs
())
{
Tensor
&
tensor
=
input_decl
.
get_tensor
();
if
(
is_temporary
(
tensor
))
...
...
@@ -49,7 +49,7 @@ bool pass::Liveness::run_on_call_graph(list<Node*>& ops)
}
unordered_set
<
Tensor
*>
output_tensor_decls
;
for
(
auto
output_decl
:
node
->
get_outputs
())
for
(
Output
&
output_decl
:
node
->
get_outputs
())
{
Tensor
&
tensor
=
output_decl
.
get_tensor
();
if
(
is_temporary
(
tensor
))
...
...
test/input_output_assign.cpp
View file @
82c405ea
...
...
@@ -31,7 +31,7 @@ TEST(input_output, param_tensor)
ASSERT_EQ
(
param
->
get_outputs
().
size
(),
1
);
for
(
size_t
i
=
0
;
i
<
param
->
get_outputs
().
size
();
i
++
)
{
auto
output
=
param
->
get_outputs
()[
i
];
auto
&
output
=
param
->
get_outputs
()[
i
];
ASSERT_EQ
(
i
,
output
.
get_index
());
ASSERT_EQ
(
param
,
output
.
get_node
());
}
...
...
@@ -52,7 +52,7 @@ TEST(input_output, param_tuple)
ASSERT_EQ
(
param
->
get_outputs
().
size
(),
2
);
for
(
size_t
i
=
0
;
i
<
param
->
get_outputs
().
size
();
i
++
)
{
auto
output
=
param
->
get_outputs
()[
i
];
auto
&
output
=
param
->
get_outputs
()[
i
];
ASSERT_EQ
(
i
,
output
.
get_index
());
ASSERT_EQ
(
param
,
output
.
get_node
());
}
...
...
@@ -87,11 +87,11 @@ TEST(input_output, simple_output)
}
// At this point, the add should have each input associated with the output of the appropriate parameter
auto
inputs
=
add
->
get_inputs
();
auto
&
inputs
=
add
->
get_inputs
();
ASSERT_EQ
(
2
,
inputs
.
size
());
for
(
size_t
i
=
0
;
i
<
inputs
.
size
();
i
++
)
{
auto
input
=
inputs
[
i
];
auto
&
input
=
inputs
[
i
];
ASSERT_EQ
(
i
,
input
.
get_index
());
ASSERT_EQ
(
i
,
input
.
get_argno
());
ASSERT_EQ
(
0
,
input
.
get_arg_index
());
...
...
test/tensor.cpp
View file @
82c405ea
...
...
@@ -49,7 +49,7 @@ TEST(tensor, size)
pass_manager
.
run_passes
(
f0
);
auto
outputs
=
arg0
->
get_outputs
();
auto
&
outputs
=
arg0
->
get_outputs
();
ASSERT_EQ
(
1
,
outputs
.
size
());
Tensor
&
output
=
outputs
[
0
].
get_tensor
();
EXPECT_EQ
(
2
*
3
*
4
,
output
.
size
());
...
...
@@ -63,7 +63,7 @@ TEST(tensor, size)
pass_manager
.
run_passes
(
f0
);
auto
outputs
=
arg0
->
get_outputs
();
auto
&
outputs
=
arg0
->
get_outputs
();
ASSERT_EQ
(
1
,
outputs
.
size
());
Tensor
&
output
=
outputs
[
0
].
get_tensor
();
EXPECT_EQ
(
1
*
4
,
output
.
size
());
...
...
@@ -77,7 +77,7 @@ TEST(tensor, size)
pass_manager
.
run_passes
(
f0
);
auto
outputs
=
arg0
->
get_outputs
();
auto
&
outputs
=
arg0
->
get_outputs
();
ASSERT_EQ
(
1
,
outputs
.
size
());
Tensor
&
output
=
outputs
[
0
].
get_tensor
();
EXPECT_EQ
(
1
*
4
,
output
.
size
());
...
...
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