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
5f1a0679
Commit
5f1a0679
authored
Jun 18, 2019
by
nishant.b.patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change onnx importer conv integer op
parent
4ec19b95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
20 deletions
+43
-20
conv_integer.cpp
src/ngraph/frontend/onnx_import/op/conv_integer.cpp
+43
-20
No files found.
src/ngraph/frontend/onnx_import/op/conv_integer.cpp
View file @
5f1a0679
...
@@ -16,9 +16,9 @@
...
@@ -16,9 +16,9 @@
#include "op/conv_integer.hpp"
#include "op/conv_integer.hpp"
#include "ngraph/builder/make_constant.hpp"
#include "ngraph/builder/make_constant.hpp"
#include "ngraph/builder/quantization/quantized_linear_convolution.hpp"
#include "ngraph/frontend/onnx_import/exceptions.hpp"
#include "ngraph/frontend/onnx_import/exceptions.hpp"
#include "ngraph/frontend/onnx_import/utils/convpool.hpp"
#include "ngraph/frontend/onnx_import/utils/convpool.hpp"
#include "ngraph/op/quantized_convolution.hpp"
using
namespace
ngraph
::
builder
;
using
namespace
ngraph
::
builder
;
...
@@ -48,35 +48,58 @@ namespace ngraph
...
@@ -48,35 +48,58 @@ namespace ngraph
const
auto
&
padding_below
=
paddings
.
first
;
const
auto
&
padding_below
=
paddings
.
first
;
const
auto
&
padding_above
=
paddings
.
second
;
const
auto
&
padding_above
=
paddings
.
second
;
const
Strides
default_data_dilation_strides
(
input
->
get_shape
().
size
()
-
2
,
1
);
const
Strides
default_data_dilation_strides
(
input
->
get_shape
().
size
()
-
2
,
1
);
auto
scale_one
=
make_constant
(
element
::
f32
,
Shape
{},
1
);
auto
input_zero_point
=
make_constant
(
input
->
get_element_type
(),
Shape
{},
0
);
auto
filters_zero_point
=
make_constant
(
filters
->
get_element_type
(),
Shape
{},
0
);
auto
output_zero_point
=
make_constant
(
output
->
get_element_type
(),
Shape
{},
0
);
if
(
num_inputs
==
2
)
if
(
num_inputs
==
2
)
{
{
return
{
quantization
::
QuantizedConvInteger
(
input
,
return
{
std
::
make_shared
<
ngraph
::
op
::
QuantizedConvolution
>
(
filters
,
input
,
window_movement_strides
,
filters
,
window_dilation_strides
,
window_movement_strides
,
padding_below
,
window_dilation_strides
,
padding_above
,
padding_below
,
default_data_dilation_strides
)};
padding_above
,
default_data_dilation_strides
,
scale_one
,
input_zero_point
,
scale_one
,
filters_zero_point
,
scale_one
,
output_zero_point
,
ngraph
::
element
::
i32
,
ngraph
::
AxisSet
{},
ngraph
::
AxisSet
{},
ngraph
::
AxisSet
{})};
}
}
auto
input_zero_point
=
inputs
.
at
(
2
);
auto
filters_zero_point
=
make_constant
(
filters
->
get_element_type
(),
Shape
{},
0
);
if
(
num_inputs
==
4
)
if
(
num_inputs
==
4
)
{
{
input_zero_point
=
inputs
.
at
(
2
);
filters_zero_point
=
inputs
.
at
(
3
);
filters_zero_point
=
inputs
.
at
(
3
);
}
}
return
{
quantization
::
QuantizedConvInteger
(
input
,
return
{
std
::
make_shared
<
ngraph
::
op
::
QuantizedConvolution
>
(
filters
,
input
,
window_movement_strides
,
filters
,
window_dilation_strides
,
window_movement_strides
,
padding_below
,
window_dilation_strides
,
padding_above
,
padding_below
,
default_data_dilation_strides
,
padding_above
,
input_zero_point
,
default_data_dilation_strides
,
filters_zero_point
)};
scale_one
,
input_zero_point
,
scale_one
,
filters_zero_point
,
scale_one
,
output_zero_point
,
ngraph
::
element
::
i32
,
ngraph
::
AxisSet
{},
ngraph
::
AxisSet
{},
ngraph
::
AxisSet
{})};
}
}
}
// namespace set_1
}
// namespace set_1
...
...
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