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
ce8c06c7
Commit
ce8c06c7
authored
Jun 14, 2019
by
Adam Procter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ditch ptrdiff_t conversion operator
parent
c146327a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
15 deletions
+5
-15
dimension.hpp
src/ngraph/dimension.hpp
+0
-10
pad.cpp
src/ngraph/op/pad.cpp
+1
-1
validation_util.cpp
src/ngraph/validation_util.cpp
+4
-4
No files found.
src/ngraph/dimension.hpp
View file @
ce8c06c7
...
@@ -71,16 +71,6 @@ namespace ngraph
...
@@ -71,16 +71,6 @@ namespace ngraph
}
}
return
m_dimension
;
return
m_dimension
;
}
}
/// \brief Convert this dimension to `ptrdiff_t`. This dimension must be static.
/// \throws std::invalid_argument If this dimension is dynamic.
explicit
operator
ptrdiff_t
()
const
{
if
(
is_dynamic
())
{
throw
std
::
invalid_argument
(
"Cannot convert dynamic dimension to ptrdiff_t"
);
}
return
static_cast
<
ptrdiff_t
>
(
m_dimension
);
}
/// \brief Check whether this dimension represents the same scheme as the argument (both
/// \brief Check whether this dimension represents the same scheme as the argument (both
/// dynamic, or equal).
/// dynamic, or equal).
...
...
src/ngraph/op/pad.cpp
View file @
ce8c06c7
...
@@ -84,7 +84,7 @@ void op::Pad::validate_and_infer_types()
...
@@ -84,7 +84,7 @@ void op::Pad::validate_and_infer_types()
if
(
arg_shape
[
i
].
is_static
())
if
(
arg_shape
[
i
].
is_static
())
{
{
ptrdiff_t
result_dim
=
ptrdiff_t
result_dim
=
m_padding_below
[
i
]
+
static_cast
<
ptrdiff
_t
>
(
arg_shape
[
i
])
+
m_padding_above
[
i
];
m_padding_below
[
i
]
+
static_cast
<
int64
_t
>
(
arg_shape
[
i
])
+
m_padding_above
[
i
];
NODE_VALIDATION_CHECK
(
this
,
NODE_VALIDATION_CHECK
(
this
,
result_dim
>=
0
,
result_dim
>=
0
,
"Inferred result dimension at axis "
,
"Inferred result dimension at axis "
,
...
...
src/ngraph/validation_util.cpp
View file @
ce8c06c7
...
@@ -142,8 +142,8 @@ PartialShape ngraph::infer_windowed_reduction_output_shape(const Node* node,
...
@@ -142,8 +142,8 @@ PartialShape ngraph::infer_windowed_reduction_output_shape(const Node* node,
ptrdiff_t
data_padded_dilated_dim
=
-
1
;
ptrdiff_t
data_padded_dilated_dim
=
-
1
;
if
(
data_dim_static
)
if
(
data_dim_static
)
{
{
data_padded_dilated_dim
=
(
static_cast
<
ptrdiff
_t
>
(
data_dilation
[
i
])
*
data_padded_dilated_dim
=
(
static_cast
<
int64
_t
>
(
data_dilation
[
i
])
*
(
static_cast
<
ptrdiff
_t
>
(
data_shape
[
i
])
-
1
))
+
(
static_cast
<
int64
_t
>
(
data_shape
[
i
])
-
1
))
+
1
+
data_padding_below
[
i
]
+
data_padding_above
[
i
];
1
+
data_padding_below
[
i
]
+
data_padding_above
[
i
];
NODE_VALIDATION_CHECK
(
NODE_VALIDATION_CHECK
(
node
,
node
,
...
@@ -158,8 +158,8 @@ PartialShape ngraph::infer_windowed_reduction_output_shape(const Node* node,
...
@@ -158,8 +158,8 @@ PartialShape ngraph::infer_windowed_reduction_output_shape(const Node* node,
ptrdiff_t
window_dilated_dim
=
-
1
;
ptrdiff_t
window_dilated_dim
=
-
1
;
if
(
window_dim_static
)
if
(
window_dim_static
)
{
{
window_dilated_dim
=
static_cast
<
ptrdiff
_t
>
(
window_dilation
[
i
])
*
window_dilated_dim
=
static_cast
<
int64
_t
>
(
window_dilation
[
i
])
*
(
static_cast
<
ptrdiff
_t
>
(
window_shape
[
i
])
-
1
)
+
(
static_cast
<
int64
_t
>
(
window_shape
[
i
])
-
1
)
+
1
;
1
;
NODE_VALIDATION_CHECK
(
node
,
NODE_VALIDATION_CHECK
(
node
,
...
...
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