Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
distiller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
distiller
Commits
a7635ea1
Commit
a7635ea1
authored
5 years ago
by
Guy Jacob
Browse files
Options
Downloads
Patches
Plain Diff
Fix type hint usage which breaks on Python 3.5
parent
25d7a7b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
distiller/quantization/quantizer.py
+2
-2
2 additions, 2 deletions
distiller/quantization/quantizer.py
with
2 additions
and
2 deletions
distiller/quantization/quantizer.py
+
2
−
2
View file @
a7635ea1
...
...
@@ -262,8 +262,8 @@ class Quantizer(object):
raise
ValueError
(
"
Adding overrides while not quantizing is not allowed.
"
)
continue
#
This hints pycharm the
replace_fn is a function
replace_fn
:
Optional
[
Callable
]
=
self
.
replacement_factory
[
type
(
module
)]
#
We use a type hint comment to let IDEs know
replace_fn is a function
replace_fn
=
self
.
replacement_factory
[
type
(
module
)]
# type: Optional[Callable]
# If the replacement function wasn't specified - continue without replacing this module.
if
replace_fn
is
not
None
:
valid_kwargs
,
invalid_kwargs
=
distiller
.
filter_kwargs
(
self
.
module_overrides_map
[
full_name
],
replace_fn
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment