Skip to content

Commit

Permalink
Fix input quantization in case of embeddings (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
vshampor committed Aug 11, 2020
1 parent 20d9e44 commit 357f96b
Show file tree
Hide file tree
Showing 3 changed files with 455 additions and 455 deletions.
6 changes: 5 additions & 1 deletion nncf/quantization/algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,11 @@ def _quantize_inputs(self, target_model: NNCFNetwork,

def traverse_function(node: NNCFNode, output) -> Tuple[bool, List[NNCFNode]]:
module = target_model.get_module_by_scope(node.op_exec_context.scope_in_model)
if is_nncf_module(module) and not isinstance(module, NNCFEmbedding): # Embeddings have integer input
if is_nncf_module(module):
if isinstance(module, NNCFEmbedding):
# Embeddings have integer input and their quantization is rather controlled
# by their weights.
return True, output
current_node_scope = node.op_exec_context.scope_in_model
module_op_insertion_commands = []
for comm in prev_weight_and_activation_quantizer_insertion_commands:
Expand Down
Loading

0 comments on commit 357f96b

Please sign in to comment.