Commit 33ac2037 by Siva Committed by Tianqi Chen

Sum operator for ONNX. (#386)

parent 4794f3d6
...@@ -235,6 +235,15 @@ def _pad(): ...@@ -235,6 +235,15 @@ def _pad():
custom_check=lambda attrs: attrs.get('mode') == 'constant')(inputs, attr) custom_check=lambda attrs: attrs.get('mode') == 'constant')(inputs, attr)
return _impl return _impl
def _sum():
def _impl(inputs, attr, params):
# Onnx Sum Operator
for in_index in range(len(inputs)-1):
inputs[in_index+1] = _sym.broadcast_add(inputs[in_index], inputs[in_index+1])
return inputs[len(inputs)-1]
return _impl
# compatible operators that do NOT require any conversion. # compatible operators that do NOT require any conversion.
_identity_list = [] _identity_list = []
...@@ -296,7 +305,7 @@ _convert_map = { ...@@ -296,7 +305,7 @@ _convert_map = {
# 'HardSigmoid' # 'HardSigmoid'
# 'Max' : this is the elemwise maximum # 'Max' : this is the elemwise maximum
# 'Min' : this is the elemwise minimum # 'Min' : this is the elemwise minimum
# 'Sum' : elemwise sum 'Sum' : _sum(),
# 'Mean' # 'Mean'
# 'Clip' # 'Clip'
# softmax default axis is different in onnx # softmax default axis is different in onnx
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment