From 2ca42189111cc33fa9bf25aa4e387b26fd2d9d84 Mon Sep 17 00:00:00 2001 From: yejianwu Date: Fri, 16 Nov 2018 19:06:00 +0800 Subject: [PATCH] remove matmul_to_fc for 2D --- mace/python/tools/converter_tool/transformer.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/mace/python/tools/converter_tool/transformer.py b/mace/python/tools/converter_tool/transformer.py index 7d689344..80dc4b04 100644 --- a/mace/python/tools/converter_tool/transformer.py +++ b/mace/python/tools/converter_tool/transformer.py @@ -1652,22 +1652,6 @@ class Transformer(base_converter.ConverterInterface): [weight_data.shape[1]] return True - # transform input(2D) -> matmul to fc - if op.type == MaceOp.MatMul.name and \ - filter_format == FilterFormat.HWIO: - producer = self._producer[op.input[0]] - weight = self._consts[op.input[1]] - if len(weight.dims) == 2 and \ - producer.type != MaceOp.Reshape.name and \ - len(producer.output_shape[0].dims) == 2 and \ - weight.dims[0] == producer.output_shape[0].dims[1]: - six.print_('convert matmul to fc') - op.type = MaceOp.FullyConnected.name - weight_data = np.array(weight.float_data).reshape( - weight.dims) - weight.dims[:] = [1, 1] + list(weight_data.shape) - return True - return False def add_device(self): -- GitLab