Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
88b081e5
Commit
88b081e5
authored
Aug 02, 2018
by
Paul
Browse files
Formatting
parent
ffcd5b35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
src/shape.cpp
src/shape.cpp
+6
-2
No files found.
src/shape.cpp
View file @
88b081e5
...
@@ -11,7 +11,8 @@ namespace migraph {
...
@@ -11,7 +11,8 @@ namespace migraph {
shape
::
shape
()
:
m_type
(
float_type
),
m_standard
(
false
)
{}
shape
::
shape
()
:
m_type
(
float_type
),
m_standard
(
false
)
{}
shape
::
shape
(
type_t
t
)
:
m_type
(
t
),
m_lens
({
1
}),
m_strides
({
1
}),
m_standard
(
true
)
{}
shape
::
shape
(
type_t
t
)
:
m_type
(
t
),
m_lens
({
1
}),
m_strides
({
1
}),
m_standard
(
true
)
{}
shape
::
shape
(
type_t
t
,
std
::
vector
<
std
::
size_t
>
l
)
:
m_type
(
t
),
m_lens
(
std
::
move
(
l
)),
m_standard
(
true
)
shape
::
shape
(
type_t
t
,
std
::
vector
<
std
::
size_t
>
l
)
:
m_type
(
t
),
m_lens
(
std
::
move
(
l
)),
m_standard
(
true
)
{
{
this
->
calculate_strides
();
this
->
calculate_strides
();
assert
(
m_lens
.
size
()
==
m_strides
.
size
());
assert
(
m_lens
.
size
()
==
m_strides
.
size
());
...
@@ -81,7 +82,10 @@ std::size_t shape::index(std::size_t i) const
...
@@ -81,7 +82,10 @@ std::size_t shape::index(std::size_t i) const
}
}
bool
shape
::
packed
()
const
{
return
this
->
elements
()
==
this
->
element_space
();
}
bool
shape
::
packed
()
const
{
return
this
->
elements
()
==
this
->
element_space
();
}
bool
shape
::
transposed
()
const
{
return
not
std
::
is_sorted
(
this
->
strides
().
rbegin
(),
this
->
strides
().
rend
());
}
bool
shape
::
transposed
()
const
{
return
not
std
::
is_sorted
(
this
->
strides
().
rbegin
(),
this
->
strides
().
rend
());
}
bool
shape
::
broadcasted
()
const
bool
shape
::
broadcasted
()
const
{
{
...
...
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