original_docstring: Map MXNet's pad operator attributes to onnx's Pad operator
      and return the created node.
      
docstring: Map MXNet's pad operator attributes to onnx's Pad operator
  and return the created node.
docstring_tokens: Map MXNet ' s pad operator attributes to onnx ' s Pad operator and return the created node .
code: def convert_pad(node, **kwargs):
      """Map MXNet's pad operator attributes to onnx's Pad operator
      and return the created node.
      """
      onnx = import_onnx_modules()
      name = node["name"]
      attrs = node["attrs"]
      proc_nodes = kwargs["proc_nodes"]
      inputs = node["inputs"]
      input_node_idx = kwargs["index_lookup"][inputs[0][0]]
      input_node = proc_nodes[input_node_idx].name
  
      mxnet_pad_width = convert_string_to_list(attrs.get("pad_width"))
      onnx_pad_width = transform_padding(mxnet_pad_width)
  
      pad_mode = attrs.get("mode")
  
      if pad_mode == "constant":
          pad_value = float(attrs.get("constant_value")) \
              if "constant_value" in attrs else 0.0
          node = onnx.helper.make_node(
              'Pad',
              inputs=[input_node],
              outputs=[name],
              mode='constant',
              value=pad_value,
              pads=onnx_pad_width,
              name=name
          )
      else:
          node = onnx.helper.make_node(
              'Pad',
              inputs=[input_node],
              outputs=[name],
              mode=pad_mode,
              pads=onnx_pad_width,
              name=name
          )
  
      return [node]
code_tokens: def convert_pad ( node , ** kwargs ) : onnx = import_onnx_modules ( ) name = node [ "name" ] attrs = node [ "attrs" ] proc_nodes = kwargs [ "proc_nodes" ] inputs = node [ "inputs" ] input_node_idx = kwargs [ "index_lookup" ] [ inputs [ 0 ] [ 0 ] ] input_node = proc_nodes [ input_node_idx ] . name mxnet_pad_width = convert_string_to_list ( attrs . get ( "pad_width" ) ) onnx_pad_width = transform_padding ( mxnet_pad_width ) pad_mode = attrs . get ( "mode" ) if pad_mode == "constant" : pad_value = float ( attrs . get ( "constant_value" ) ) if "constant_value" in attrs else 0.0 node = onnx . helper . make_node ( 'Pad' , inputs = [ input_node ] , outputs = [ name ] , mode = 'constant' , value = pad_value , pads = onnx_pad_width , name = name ) else : node = onnx . helper . make_node ( 'Pad' , inputs = [ input_node ] , outputs = [ name ] , mode = pad_mode , pads = onnx_pad_width , name = name ) return [ node ]
short_docstring: Map MXNet's pad operator attributes to onnx's Pad operator
  and return the created node.
short_docstring_tokens: Map MXNet ' s pad operator attributes to onnx ' s Pad operator and return the created node .
comment: """Map MXNet's pad operator attributes to onnx's Pad operator
      and return the created node.
      """