NNgen / nngen

NNgen: A Fully-Customizable Hardware Synthesis Compiler for Deep Neural Network
Apache License 2.0
340 stars 46 forks source link

Support MatMul operator when loading onnx #17

Closed kindsenior closed 4 years ago

kindsenior commented 4 years ago

Nice to send you a Pull Request. I'm Kunio Kojima at the University of Tokyo and a beginner of nngen.

When we loaded a network from an onnx file like nngen.from_onnx(filename), we got the follow.

/usr/local/lib/python3.7/dist-packages/nngen-1.3.0-py3.7.egg/nngen/onnx/init.py in _get_func(op_type) def _get_func(op_type) --->return func_map[op_type] KeyError: 'Mat'

It seems that nngen supports MatMul (nngen.operator.matmul). However, it does not support loading MatMul operator from onnx file. https://github.com/NNgen/nngen/blob/cba265b1a140f2aef7208926703782b6dac9e8be/nngen/onnx/__init__.py#L36-L71

Therefore, we added a mapping from onnx's MatMul to nngen.operator.matmul.

kindsenior commented 4 years ago

Sorry. I have misunderstood the operator.basic. I understand it is the operator for element-wise procedures. Therefore, my implementation is wrong.