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
b4d6dfd4
Commit
b4d6dfd4
authored
May 24, 2019
by
nishant.b.patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change QuantizedConvolutionBuilder api to take axes
parent
34806616
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
quantized_conv_builder.cpp
src/ngraph/builder/quantized_conv_builder.cpp
+3
-4
quantized_conv_builder.hpp
src/ngraph/builder/quantized_conv_builder.hpp
+2
-1
builder_quantization.cpp
test/builder_quantization.cpp
+4
-2
No files found.
src/ngraph/builder/quantized_conv_builder.cpp
View file @
b4d6dfd4
...
...
@@ -39,7 +39,8 @@ namespace ngraph
const
shared_ptr
<
Node
>&
max_filter
,
const
shared_ptr
<
Node
>&
min_output
,
const
shared_ptr
<
Node
>&
max_output
,
const
ngraph
::
element
::
Type
&
output_type
)
const
ngraph
::
element
::
Type
&
output_type
,
const
ngraph
::
AxisSet
&
axes
)
{
auto
input_scale
=
quantization_scale
::
get_scale
(
min_input
,
max_input
,
input
->
get_element_type
());
...
...
@@ -53,8 +54,6 @@ namespace ngraph
auto
filter_zero_point
=
op
::
Constant
::
create
(
filters
->
get_element_type
(),
Shape
{},
{
0
});
AxisSet
quantization_axes
;
return
make_shared
<
op
::
QuantizedConvolution
>
(
input
,
filters
,
...
...
@@ -70,7 +69,7 @@ namespace ngraph
output_scale
,
filter_zero_point
,
// output type will be same as filter
output_type
,
quantization_
axes
);
axes
);
}
}
}
src/ngraph/builder/quantized_conv_builder.hpp
View file @
b4d6dfd4
...
...
@@ -38,6 +38,7 @@ namespace ngraph
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
::
element
::
Type
&
output_type
,
const
ngraph
::
AxisSet
&
axes
);
}
}
test/builder_quantization.cpp
View file @
b4d6dfd4
...
...
@@ -174,7 +174,8 @@ TEST(builder, scaled_QC)
F
,
G
,
H
,
element
::
i8
);
element
::
i8
,
AxisSet
{});
auto
f
=
make_shared
<
Function
>
(
NodeVector
{
CV
},
ParameterVector
{
A
,
B
});
constant_fold
(
f
);
...
...
@@ -254,7 +255,8 @@ TEST(builder, dynamic_scaled_QC)
F
,
G
,
H
,
element
::
i8
);
element
::
i8
,
AxisSet
{});
auto
f
=
make_shared
<
Function
>
(
NodeVector
{
CV
},
ParameterVector
{
A
,
B
,
C
,
D
,
E
,
F
,
G
,
H
});
auto
backend
=
runtime
::
Backend
::
create
(
"CPU"
);
// Create some tensors for input/output
...
...
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