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
a91abd8b
Commit
a91abd8b
authored
Jun 12, 2019
by
nishant.b.patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some more checks for quantized conv op
parent
65ad5f08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
quantized_convolution.cpp
src/ngraph/op/quantized_convolution.cpp
+22
-0
quantized_convolution.hpp
src/ngraph/op/quantized_convolution.hpp
+7
-1
No files found.
src/ngraph/op/quantized_convolution.cpp
View file @
a91abd8b
...
...
@@ -97,6 +97,22 @@ void op::QuantizedConvolution::validate_and_infer_types()
get_input_element_type
(
1
),
")"
);
// TODO Remove these checks once we support channelwise and vector of scales
NODE_VALIDATION_CHECK
(
this
,
shape_size
(
get_input_shape
(
2
))
==
1
||
shape_size
(
get_input_shape
(
3
))
==
1
,
"Input scale and input zero point shape must be same and 1"
);
NODE_VALIDATION_CHECK
(
this
,
shape_size
(
get_input_shape
(
4
))
==
1
||
shape_size
(
get_input_shape
(
5
))
==
1
,
"Filter scale and filter zero point shape must be same and 1"
);
NODE_VALIDATION_CHECK
(
this
,
shape_size
(
get_input_shape
(
6
))
==
1
||
shape_size
(
get_input_shape
(
7
))
==
1
,
"Output scale and output zero point shape must be same and 1"
);
auto
input_shape
=
get_input_shape
(
0
);
auto
filters_shape
=
get_input_shape
(
1
);
...
...
@@ -172,3 +188,9 @@ shared_ptr<Node> op::QuantizedConvolution::copy_with_new_args(const NodeVector&
m_filter_axes
,
m_output_axes
));
}
void
op
::
QuantizedConvolution
::
generate_adjoints
(
autodiff
::
Adjoints
&
adjoints
,
const
NodeVector
&
deltas
)
{
throw
ngraph_error
(
"Forward-propagation-only operation"
);
}
src/ngraph/op/quantized_convolution.hpp
View file @
a91abd8b
...
...
@@ -42,7 +42,9 @@ namespace ngraph
/// \param output_scale Scale to transform the output
/// \param output_zero_point Zero point used for mapping
/// \param output_type Output element type
///
/// \param input_axes Input axes set for channel wise quantization
/// \param filter_axes Filter axes set for channel wise quantization
/// \param output_axes Output axes set for channel wise quantization
QuantizedConvolution
(
const
std
::
shared_ptr
<
Node
>&
input
,
const
std
::
shared_ptr
<
Node
>&
filters
,
const
Strides
&
window_movement_strides
,
...
...
@@ -60,6 +62,7 @@ namespace ngraph
const
ngraph
::
AxisSet
&
input_axes
,
const
ngraph
::
AxisSet
&
filter_axes
,
const
ngraph
::
AxisSet
&
output_axes
);
const
Strides
&
get_window_movement_strides
()
const
{
return
m_window_movement_strides
;
}
const
Strides
&
get_window_dilation_strides
()
const
{
return
m_window_dilation_strides
;
}
const
CoordinateDiff
&
get_padding_below
()
const
{
return
m_padding_below
;
}
...
...
@@ -75,6 +78,9 @@ namespace ngraph
virtual
std
::
shared_ptr
<
Node
>
copy_with_new_args
(
const
NodeVector
&
new_args
)
const
override
;
virtual
void
generate_adjoints
(
autodiff
::
Adjoints
&
adjoints
,
const
NodeVector
&
deltas
)
override
;
protected
:
Strides
m_window_movement_strides
;
Strides
m_window_dilation_strides
;
...
...
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