Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
4b743676
Unverified
Commit
4b743676
authored
Feb 06, 2019
by
ziheng
Committed by
GitHub
Feb 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BUGFIX] Fix for quantize. (#2573)
parent
f0ae8e31
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
6 deletions
+3
-6
python/tvm/autotvm/task/relay_integration.py
+0
-2
src/relay/pass/quantize.cc
+2
-3
src/relay/pass/quantize.h
+1
-1
No files found.
python/tvm/autotvm/task/relay_integration.py
View file @
4b743676
...
...
@@ -31,8 +31,6 @@ def extract_from_program(func, params, ops, target, target_host=None):
The associated parameters of the program
ops: List of relay op
List of relay ops to be tuned
dtype: str or dict of str to str
The input types to the program
target: tvm.target.Target
The compilation target
target_host: tvm.target.Target
...
...
src/relay/pass/quantize.cc
View file @
4b743676
...
...
@@ -231,7 +231,7 @@ Expr QuantizeRealize(const Call& ref_call,
return
QRealizeIntExprNode
::
make
(
round_data
,
dom_scale
,
Float
(
32
));
}
RELAY_REGISTER_OP
(
"simulated_quantize"
)
RELAY_REGISTER_OP
(
"
relay.op.annotation.
simulated_quantize"
)
.
set_attr
<
FForwardRewrite
>
(
"FQRealizeRewrite"
,
QuantizeRealize
);
...
...
@@ -350,7 +350,6 @@ Array<Expr> UnifyDTypeScale(const Array<Expr>& args,
Expr
dom_scale
=
MakeConstantScalar
(
Float
(
32
),
s
);
for
(
size_t
i
=
0
;
i
<
ret
.
size
();
++
i
)
{
float
cur_s
=
GetScalarFromConstant
<
float
>
(
nptrs
[
i
]
->
dom_scale
);
LOG
(
INFO
)
<<
"unify data scale from "
<<
cur_s
<<
" to "
<<
s
;
ret
.
Set
(
i
,
MulAndDiv
(
ret
[
i
],
cur_s
,
s
));
}
...
...
@@ -504,7 +503,7 @@ void QConfig::ExitQConfigScope() {
entry
->
context_stack
.
pop
();
}
QConfig
QConfig
::
Current
()
{
QConfig
&
QConfig
::
Current
()
{
TVMQConfigThreadLocalEntry
*
entry
=
TVMQConfigThreadLocalStore
::
Get
();
if
(
entry
->
context_stack
.
size
()
>
0
)
{
return
entry
->
context_stack
.
top
();
...
...
src/relay/pass/quantize.h
View file @
4b743676
...
...
@@ -162,7 +162,7 @@ class QConfig : public NodeRef {
* configuration if a BuildConfig scope has not been entered.
* \return The configuration that is the current context.
*/
static
QConfig
Current
();
static
QConfig
&
Current
();
using
ContainerType
=
QConfigNode
;
};
...
...
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