class_docstr: Class to convert MXNet to ONNX graph
class_docstr_tok: ["Class","to","convert","MXNet","to","ONNX","graph"]
docstr: Convert MXNet layer to ONNX
docstr_tok: ["Convert","MXNet","layer","to","ONNX"]
code: def convert_layer(node, **kwargs):
      """Convert MXNet layer to ONNX"""
      try:
          from onnx.defs import onnx_opset_version
      except ImportError:
          raise ImportError(
              "Onnx and protobuf need to be installed. "
              + "Instructions to install - https://github.com/onnx/onnx"
          )
  
      op = str(node["op"])
      opset_version = kwargs.get("opset_version", onnx_opset_version())
      if opset_version < 12:
          logging.warning(
              "Your ONNX op set version is {}, "
              "which is lower than then lowest tested op set (12), please consider "
              "updating ONNX".format(str(opset_version))
          )
          opset_version = 12
      # Fallback to older opset versions if op is not registered in current version
      convert_func = None
      for op_version in range(opset_version, 11, -1):
          if (
              op_version not in MXNetGraph.registry_
              or op not in MXNetGraph.registry_[op_version]
          ):
              continue
          convert_func = MXNetGraph.registry_[op_version][op]
          break
  
      # The conversion logic is not implemented
      if convert_func is None:
          raise AttributeError(
              f"No conversion function registered for op type {op} yet."
          )
  
      ret = convert_func(node, **kwargs)
      # in case the conversion function does not specify the returned dtype, we just return None
      # as the second value
      if isinstance(ret, list):
          return ret, None
      else:
          return ret
  
file_path: mxnet/python/mxnet/onnx/mx2onnx/_export_onnx.py
imports: import logging
  import json
  import numpy
  from mxnet import ndarray
label_desc: Use image node_id 3 for calling the MXNetGraph obj's underlying member method code with example usage: obj.convert_layer(node) and returns: ret,  None, ret