From 9af702f9e034b8c1a55c8a833d9d5dbe13779b29 Mon Sep 17 00:00:00 2001 From: yejianwu Date: Thu, 21 Feb 2019 19:26:38 +0800 Subject: [PATCH] fix matmul to fc transformer --- mace/python/tools/converter_tool/transformer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mace/python/tools/converter_tool/transformer.py b/mace/python/tools/converter_tool/transformer.py index 33d46336..54c89cb9 100644 --- a/mace/python/tools/converter_tool/transformer.py +++ b/mace/python/tools/converter_tool/transformer.py @@ -1298,7 +1298,8 @@ class Transformer(base_converter.ConverterInterface): # transform `fc1(2D) -> matmul` to `fc1(2D) -> fc1(2D)` if op.type == MaceOp.MatMul.name and \ - filter_format == FilterFormat.HWIO: + filter_format == FilterFormat.HWIO and \ + op.input[1] in self._consts: producer = self._producer[op.input[0]] weight = self._consts[op.input[1]] if len(weight.dims) == 2 and self.is_after_fc(op) and \ -- GitLab