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
d9004a3f
Commit
d9004a3f
authored
Sep 26, 2018
by
Adam Procter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some renaming
parent
4db9fac4
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
33 deletions
+30
-33
length.cpp
src/ngraph/length.cpp
+3
-2
length.hpp
src/ngraph/length.hpp
+5
-5
partial_shape.cpp
src/ngraph/partial_shape.cpp
+8
-8
partial_shape.hpp
src/ngraph/partial_shape.hpp
+6
-6
rank.cpp
src/ngraph/rank.cpp
+3
-3
rank.hpp
src/ngraph/rank.hpp
+1
-1
undetermined.cpp
src/ngraph/undetermined.cpp
+3
-4
undetermined.hpp
src/ngraph/undetermined.hpp
+1
-4
No files found.
src/ngraph/length.cpp
View file @
d9004a3f
...
...
@@ -18,7 +18,7 @@
std
::
ostream
&
ngraph
::
operator
<<
(
std
::
ostream
&
str
,
const
Length
&
length
)
{
if
(
length
.
fix
ed
())
if
(
length
.
is_determin
ed
())
{
return
(
str
<<
size_t
(
length
));
}
...
...
@@ -30,5 +30,6 @@ std::ostream& ngraph::operator<<(std::ostream& str, const Length& length)
ngraph
::
Length
ngraph
::
operator
+
(
const
Length
&
l1
,
const
Length
&
l2
)
{
return
(
l1
.
fixed
()
&&
l2
.
fixed
()
?
size_t
(
l1
)
+
size_t
(
l2
)
:
Length
(
undet
));
return
(
l1
.
is_determined
()
&&
l2
.
is_determined
()
?
size_t
(
l1
)
+
size_t
(
l2
)
:
Length
(
undetermined
));
}
src/ngraph/length.hpp
View file @
d9004a3f
...
...
@@ -29,24 +29,24 @@ namespace ngraph
public
:
Length
(
size_t
length
)
:
m_length
(
length
)
,
m_
fix
ed
(
true
)
,
m_
is_determin
ed
(
true
)
{
}
Length
(
const
Undetermined
&
)
:
m_length
(
0
)
,
m_
fix
ed
(
false
)
,
m_
is_determin
ed
(
false
)
{
}
Length
()
:
m_length
(
0
)
,
m_
fix
ed
(
true
)
,
m_
is_determin
ed
(
true
)
{
}
bool
fixed
()
const
{
return
m_fix
ed
;
}
bool
is_determined
()
const
{
return
m_is_determin
ed
;
}
explicit
operator
size_t
()
const
{
return
m_length
;
}
private
:
size_t
m_length
;
bool
m_
fix
ed
;
bool
m_
is_determin
ed
;
};
std
::
ostream
&
operator
<<
(
std
::
ostream
&
str
,
const
Length
&
length
);
...
...
src/ngraph/partial_shape.cpp
View file @
d9004a3f
...
...
@@ -21,18 +21,18 @@
using
namespace
ngraph
;
bool
ngraph
::
PartialShape
::
fixed
()
const
bool
ngraph
::
PartialShape
::
is_complete
()
const
{
return
m_rank_
fixed
&&
std
::
all_of
(
m_lengths
.
begin
(),
m_lengths
.
end
(),
[](
const
Length
&
l
)
{
return
l
.
fixed
();
});
return
m_rank_
is_determined
&&
std
::
all_of
(
m_lengths
.
begin
(),
m_lengths
.
end
(),
[](
const
Length
&
l
)
{
return
l
.
is_determined
();
});
}
ngraph
::
PartialShape
ngraph
::
operator
+
(
const
PartialShape
&
s1
,
const
PartialShape
&
s2
)
{
if
(
!
s1
.
rank_
fixed
()
||
!
s2
.
rank_fix
ed
())
if
(
!
s1
.
rank_
is_determined
()
||
!
s2
.
rank_is_determin
ed
())
{
return
undet
;
return
undet
ermined
;
}
if
(
s1
.
rank
()
!=
s2
.
rank
())
...
...
@@ -41,7 +41,7 @@ ngraph::PartialShape ngraph::operator+(const PartialShape& s1, const PartialShap
}
PartialShape
result
{};
result
.
m_rank_
fix
ed
=
true
;
result
.
m_rank_
is_determin
ed
=
true
;
for
(
size_t
i
=
0
;
i
<
s1
.
m_lengths
.
size
();
i
++
)
{
result
.
m_lengths
.
push_back
(
s1
.
m_lengths
[
i
]
+
s2
.
m_lengths
[
i
]);
...
...
@@ -51,7 +51,7 @@ ngraph::PartialShape ngraph::operator+(const PartialShape& s1, const PartialShap
std
::
ostream
&
ngraph
::
operator
<<
(
std
::
ostream
&
str
,
const
PartialShape
&
shape
)
{
if
(
shape
.
m_rank_
fix
ed
)
if
(
shape
.
m_rank_
is_determin
ed
)
{
str
<<
"{"
;
bool
first
=
true
;
...
...
src/ngraph/partial_shape.hpp
View file @
d9004a3f
...
...
@@ -29,24 +29,24 @@ namespace ngraph
{
public
:
PartialShape
(
std
::
initializer_list
<
Length
>
init
)
:
m_rank_
fix
ed
(
true
)
:
m_rank_
is_determin
ed
(
true
)
,
m_lengths
(
init
)
{
}
PartialShape
(
const
Undetermined
&
)
:
m_rank_
fix
ed
(
false
)
:
m_rank_
is_determin
ed
(
false
)
,
m_lengths
()
{
}
bool
rank_
fixed
()
const
{
return
m_rank_fix
ed
;
}
bool
fixed
()
const
;
Rank
rank
()
const
{
return
m_rank_
fixed
?
Rank
(
m_lengths
.
size
())
:
undet
;
}
bool
rank_
is_determined
()
const
{
return
m_rank_is_determin
ed
;
}
bool
is_complete
()
const
;
Rank
rank
()
const
{
return
m_rank_
is_determined
?
Rank
(
m_lengths
.
size
())
:
undetermined
;
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
str
,
const
PartialShape
&
shape
);
friend
PartialShape
operator
+
(
const
PartialShape
&
s1
,
const
PartialShape
&
s2
);
PartialShape
append
(
const
PartialShape
&
other
);
private
:
bool
m_rank_
fix
ed
;
bool
m_rank_
is_determin
ed
;
std
::
vector
<
Length
>
m_lengths
;
};
...
...
src/ngraph/rank.cpp
View file @
d9004a3f
...
...
@@ -18,7 +18,7 @@
std
::
ostream
&
ngraph
::
operator
<<
(
std
::
ostream
&
str
,
const
Rank
&
rank
)
{
if
(
rank
.
fixed
())
if
(
rank
.
is_
fixed
())
{
return
(
str
<<
size_t
(
rank
));
}
...
...
@@ -30,10 +30,10 @@ std::ostream& ngraph::operator<<(std::ostream& str, const Rank& rank)
bool
ngraph
::
operator
==
(
const
Rank
&
r1
,
const
Rank
&
r2
)
{
return
(
r1
.
fixed
()
&&
r2
.
fixed
()
&&
size_t
(
r1
)
==
size_t
(
r2
));
return
(
r1
.
is_fixed
()
&&
r2
.
is_
fixed
()
&&
size_t
(
r1
)
==
size_t
(
r2
));
}
bool
ngraph
::
operator
!=
(
const
Rank
&
r1
,
const
Rank
&
r2
)
{
return
(
r1
.
fixed
()
&&
r2
.
fixed
()
&&
size_t
(
r1
)
!=
size_t
(
r2
));
return
(
r1
.
is_fixed
()
&&
r2
.
is_
fixed
()
&&
size_t
(
r1
)
!=
size_t
(
r2
));
}
src/ngraph/rank.hpp
View file @
d9004a3f
...
...
@@ -42,7 +42,7 @@ namespace ngraph
,
m_fixed
(
true
)
{
}
bool
fixed
()
const
{
return
m_fixed
;
}
bool
is_
fixed
()
const
{
return
m_fixed
;
}
explicit
operator
size_t
()
const
{
return
m_rank
;
}
private
:
size_t
m_rank
;
...
...
src/ngraph/undetermined.cpp
View file @
d9004a3f
...
...
@@ -16,7 +16,6 @@
#include "ngraph/undetermined.hpp"
std
::
ostream
&
ngraph
::
operator
<<
(
std
::
ostream
&
str
,
const
Undetermined
&
)
{
return
(
str
<<
"?"
);
}
using
namespace
ngraph
;
const
Undetermined
ngraph
::
undetermined
{};
src/ngraph/undetermined.hpp
View file @
d9004a3f
...
...
@@ -26,10 +26,7 @@ namespace ngraph
{
public
:
Undetermined
()
{}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
str
,
const
Undetermined
&
);
};
std
::
ostream
&
operator
<<
(
std
::
ostream
&
str
,
const
Undetermined
&
);
const
ngraph
::
Undetermined
undet
;
extern
const
Undetermined
undetermined
;
}
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