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
c8288d48
Commit
c8288d48
authored
Jun 27, 2019
by
nishant.b.patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make input, filter and output axes optional for QuantizedConv op
parent
ada5c18f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
33 deletions
+31
-33
quantized_conv_builder.hpp
src/ngraph/builder/quantized_conv_builder.hpp
+18
-17
quantized_convolution.cpp
src/ngraph/op/quantized_convolution.cpp
+6
-0
quantized_convolution.hpp
src/ngraph/op/quantized_convolution.hpp
+3
-3
backend_test.in.cpp
test/backend_test.in.cpp
+4
-13
No files found.
src/ngraph/builder/quantized_conv_builder.hpp
View file @
c8288d48
...
...
@@ -25,22 +25,23 @@ namespace ngraph
{
namespace
builder
{
std
::
shared_ptr
<
Node
>
QuantizedConvolutionBuilder
(
const
std
::
shared_ptr
<
Node
>&
input
,
const
std
::
shared_ptr
<
Node
>&
filters
,
const
Strides
&
window_movement_strides
,
const
Strides
&
window_dilation_strides
,
const
CoordinateDiff
&
padding_below
,
const
CoordinateDiff
&
padding_above
,
const
Strides
&
data_dilation_strides
,
const
std
::
shared_ptr
<
Node
>&
min_input
,
const
std
::
shared_ptr
<
Node
>&
max_input
,
const
std
::
shared_ptr
<
Node
>&
min_filter
,
const
std
::
shared_ptr
<
Node
>&
max_filter
,
const
std
::
shared_ptr
<
Node
>&
min_output
,
const
std
::
shared_ptr
<
Node
>&
max_output
,
const
ngraph
::
element
::
Type
&
output_type
,
const
ngraph
::
AxisSet
&
input_axes
,
const
ngraph
::
AxisSet
&
filter_axes
,
const
ngraph
::
AxisSet
&
output_axes
);
std
::
shared_ptr
<
Node
>
QuantizedConvolutionBuilder
(
const
std
::
shared_ptr
<
Node
>&
input
,
const
std
::
shared_ptr
<
Node
>&
filters
,
const
Strides
&
window_movement_strides
,
const
Strides
&
window_dilation_strides
,
const
CoordinateDiff
&
padding_below
,
const
CoordinateDiff
&
padding_above
,
const
Strides
&
data_dilation_strides
,
const
std
::
shared_ptr
<
Node
>&
min_input
,
const
std
::
shared_ptr
<
Node
>&
max_input
,
const
std
::
shared_ptr
<
Node
>&
min_filter
,
const
std
::
shared_ptr
<
Node
>&
max_filter
,
const
std
::
shared_ptr
<
Node
>&
min_output
,
const
std
::
shared_ptr
<
Node
>&
max_output
,
const
ngraph
::
element
::
Type
&
output_type
,
const
ngraph
::
AxisSet
&
input_axes
=
ngraph
::
AxisSet
{},
const
ngraph
::
AxisSet
&
filter_axes
=
ngraph
::
AxisSet
{},
const
ngraph
::
AxisSet
&
output_axes
=
ngraph
::
AxisSet
{});
}
}
src/ngraph/op/quantized_convolution.cpp
View file @
c8288d48
...
...
@@ -141,6 +141,12 @@ void op::QuantizedConvolution::validate_and_infer_types()
get_input_partial_shape
(
7
).
compatible
(
PartialShape
{}),
"Output scale and output zero point shape must be same and 1"
);
// AxisSet should be empty till we support channel wise quantization
NODE_VALIDATION_CHECK
(
this
,
m_input_axes
==
AxisSet
{}
&&
m_filter_axes
==
AxisSet
{}
&&
m_output_axes
==
AxisSet
{},
"Input, filter and output AxisSet should be empty"
);
const
PartialShape
&
input_shape
=
get_input_partial_shape
(
0
);
const
PartialShape
&
filters_shape
=
get_input_partial_shape
(
1
);
...
...
src/ngraph/op/quantized_convolution.hpp
View file @
c8288d48
...
...
@@ -59,9 +59,9 @@ namespace ngraph
const
std
::
shared_ptr
<
Node
>&
output_scale
,
const
std
::
shared_ptr
<
Node
>&
output_zero_point
,
const
ngraph
::
element
::
Type
&
output_type
,
const
ngraph
::
AxisSet
&
input_axes
,
const
ngraph
::
AxisSet
&
filter_axes
,
const
ngraph
::
AxisSet
&
output_axes
);
const
ngraph
::
AxisSet
&
input_axes
=
ngraph
::
AxisSet
{}
,
const
ngraph
::
AxisSet
&
filter_axes
=
ngraph
::
AxisSet
{}
,
const
ngraph
::
AxisSet
&
output_axes
=
ngraph
::
AxisSet
{}
);
const
Strides
&
get_window_movement_strides
()
const
{
return
m_window_movement_strides
;
}
const
Strides
&
get_window_dilation_strides
()
const
{
return
m_window_dilation_strides
;
}
...
...
test/backend_test.in.cpp
View file @
c8288d48
...
...
@@ -7557,10 +7557,7 @@ NGRAPH_TEST(${BACKEND_NAME}, quantized_convolution)
F
,
G
,
H
,
element
::
i8
,
AxisSet
{},
AxisSet
{},
AxisSet
{});
element
::
i8
);
auto
f
=
make_shared
<
Function
>
(
NodeVector
{
CV
},
ParameterVector
{
A
,
B
,
C
,
D
,
E
,
F
,
G
,
H
});
auto
backend
=
runtime
::
Backend
::
create
(
"${BACKEND_NAME}"
);
// Create some tensors for input/output
...
...
@@ -7692,10 +7689,7 @@ NGRAPH_TEST(${BACKEND_NAME}, quantized_conv_non_zero_zero_point)
rhs_zero_point
,
result_scale
,
result_zero_point
,
element
::
u8
,
AxisSet
{},
AxisSet
{},
AxisSet
{});
element
::
u8
);
auto
f
=
make_shared
<
Function
>
(
NodeVector
{
CV
},
ParameterVector
{
A
,
B
});
// Create some tensors for input/output
auto
a
=
backend
->
create_tensor
(
element
::
u8
,
shape_a
);
...
...
@@ -7713,7 +7707,7 @@ NGRAPH_TEST(${BACKEND_NAME}, quantized_conv_non_zero_zero_point)
}
}
TEST
(
$
{
BACKEND_NAME
},
quantized_conv_int32_output
)
NGRAPH_
TEST
(
$
{
BACKEND_NAME
},
quantized_conv_int32_output
)
{
Shape
shape_a
{
1
,
1
,
3
,
4
};
Shape
shape_b
{
1
,
1
,
3
,
3
};
...
...
@@ -7741,10 +7735,7 @@ TEST(${BACKEND_NAME}, quantized_conv_int32_output)
F
,
G
,
H
,
element
::
i32
,
AxisSet
{},
AxisSet
{},
AxisSet
{});
element
::
i32
);
auto
f
=
make_shared
<
Function
>
(
NodeVector
{
CV
},
ParameterVector
{
A
,
B
,
C
,
E
,
G
});
auto
backend
=
runtime
::
Backend
::
create
(
"${BACKEND_NAME}"
);
...
...
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