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
036eafe0
Commit
036eafe0
authored
Sep 20, 2017
by
Yixing Lao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix failing build of operator overloading
parent
c7cc170c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
30 deletions
+36
-30
tensor.cpp
src/descriptor/tensor.cpp
+26
-21
tensor.hpp
src/descriptor/tensor.hpp
+10
-9
No files found.
src/descriptor/tensor.cpp
View file @
036eafe0
...
...
@@ -15,28 +15,33 @@
#include "descriptor/tensor.hpp"
#include "node.hpp"
using
namespace
ngraph
;
using
namespace
descriptor
;
Tensor
::
Tensor
(
const
element
::
Type
&
element_type
,
PrimaryTensorView
*
primary_tensor_view
,
const
Node
*
parent
,
size_t
value_index
)
:
m_element_type
(
element_type
)
,
m_primary_tensor_view
(
primary_tensor_view
)
,
m_is_output
{
false
}
,
m_is_input
{
parent
->
is_parameter
()}
,
m_is_persistent
{
false
}
,
m_name
{
parent
->
get_node_id
()
+
"_"
+
std
::
to_string
(
value_index
)}
,
m_next_view_id
{
0
}
namespace
ngraph
{
}
namespace
descriptor
{
Tensor
::
Tensor
(
const
element
::
Type
&
element_type
,
PrimaryTensorView
*
primary_tensor_view
,
const
Node
*
parent
,
size_t
value_index
)
:
m_element_type
(
element_type
)
,
m_primary_tensor_view
(
primary_tensor_view
)
,
m_is_output
{
false
}
,
m_is_input
{
parent
->
is_parameter
()}
,
m_is_persistent
{
false
}
,
m_name
{
parent
->
get_node_id
()
+
"_"
+
std
::
to_string
(
value_index
)}
,
m_next_view_id
{
0
}
{
}
std
::
string
Tensor
::
get_next_view_name
()
{
return
m_name
+
"_TV"
+
std
::
to_string
(
m_next_view_id
++
);
}
std
::
string
Tensor
::
get_next_view_name
()
{
return
m_name
+
"_TV"
+
std
::
to_string
(
m_next_view_id
++
);
}
std
::
ostream
&
ngraph
::
descriptor
::
operator
<<
(
std
::
ostream
&
out
,
const
Tensor
&
tensor
)
{
out
<<
"Tensor("
<<
tensor
.
get_name
()
<<
")"
;
return
out
;
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
Tensor
&
tensor
)
{
out
<<
"Tensor("
<<
tensor
.
get_name
()
<<
")"
;
return
out
;
}
}
}
src/descriptor/tensor.hpp
View file @
036eafe0
...
...
@@ -14,9 +14,9 @@
#pragma once
#include <iostream>
#include <memory>
#include <vector>
#include <iostream>
namespace
ngraph
{
...
...
@@ -40,19 +40,18 @@ namespace ngraph
Tensor
(
const
Tensor
&
)
=
delete
;
Tensor
&
operator
=
(
const
Tensor
&
)
=
delete
;
Tensor
(
const
element
::
Type
&
element_type
,
PrimaryTensorView
*
tensor_view
,
const
Node
*
parent
,
size_t
value_index
);
Tensor
(
const
element
::
Type
&
element_type
,
PrimaryTensorView
*
tensor_view
,
const
Node
*
parent
,
size_t
value_index
);
std
::
string
get_next_view_name
();
public
:
bool
is_output
()
const
{
return
m_is_output
;
}
bool
is_input
()
const
{
return
m_is_input
;
}
bool
is_persistent
()
const
{
return
m_is_persistent
;
}
bool
is_output
()
const
{
return
m_is_output
;
}
bool
is_input
()
const
{
return
m_is_input
;
}
bool
is_persistent
()
const
{
return
m_is_persistent
;
}
const
std
::
string
&
get_name
()
const
{
return
m_name
;
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
,
const
Tensor
&
);
protected
:
const
element
::
Type
&
m_element_type
;
PrimaryTensorView
*
m_primary_tensor_view
;
...
...
@@ -62,5 +61,7 @@ namespace ngraph
std
::
string
m_name
;
size_t
m_next_view_id
;
};
std
::
ostream
&
operator
<<
(
std
::
ostream
&
,
const
Tensor
&
);
}
}
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