σ ω΅Θ[c@@spdZddlmZddlmZddlmZddlm Z ddl m Z d e fd „ƒYZd S( s Support import export formats.i(tabsolute_importi(tsymbol(tndarray(t string_typesi(t _convert_mapt GraphProtocB@sMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(s“A helper class for handling mxnet symbol copying from pb2.GraphProto. Definition: https://github.com/onnx/onnx/blob/master/onnx/onnx.proto cC@sCi|_i|_d|_d|_i|_i|_i|_dS(Ni(t_nodest_paramst _num_inputt _num_paramtaux_dicttarg_dicttmodel_metadata(tself((sf/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/contrib/onnx/onnx2mx/import_onnx.pyt__init__s      cC@s½|tkr.t||||ƒ\}}}ntdj|ƒƒ‚t|tƒrΉtt|dƒ}|s‚tdj|ƒƒ‚n|dkr |||Ž}n|d|||Ž}|S|S(ssConvert from onnx operator to mxnet operator. The converter must specify conversions explicitly for incompatible name, and apply handlers to operator attributes. Parameters ---------- :param node_name : str name of the node to be translated. :param op_name : str Operator name, such as Convolution, FullyConnected :param attrs : dict Dict of operator attributes :param inputs: list list of inputs to the operator Returns ------- :return mxnet_sym Converted mxnet symbol sOperator {} not implemented.sUnable to map op_name {} to symtnameN( t convert_maptNotImplementedErrortformatt isinstanceRtgetattrRtNonet RuntimeError(R t node_nametop_nametattrstinputst new_attrstnew_opt mxnet_sym((sf/usr/local/lib/python2.7/site-packages/mxnet-1.3.1-py2.7.egg/mxnet/contrib/onnx/onnx2mx/import_onnx.pyt_convert_operator(s " cC@s΅|j|ƒ|_xH|jD]=}|jjƒs@tdƒ‚n|j|ƒ|j|js