parameters: (cls,
                                   graph,
                                   device,
                                   opset_version=_opset_version)
return_statement: return params, inputs, outputs, operators
docstring: get all intermediate params, operators, and input info from onnx model
          Args:
              graph (Graph): the loaded ONNX graph
              device (string): CPU or CUDA
              opset_version (int): the opset version
          Returns:
              a dict of weights
              a dict of ValueInfo
              a dict of ValueInfo
              a list of SingaOps('node', 'forward')
docstring_summary: get all intermediate params, operators, and input info from onnx model
          Args:
              graph (Graph): the loaded ONNX graph
              device (string): CPU or CUDA
              opset_version (int): the opset version
          Returns:
              a dict of weights
              a dict of ValueInfo
              a dict of ValueInfo
              a list of SingaOps('node', 'forward')
docstring_tokens: get all intermediate params operators and input info from onnx model Args : graph ( Graph ) : the loaded ONNX graph device ( string ) : CPU or CUDA opset_version ( int ) : the opset version Returns : a dict of weights a dict of ValueInfo a dict of ValueInfo a list of SingaOps ( node forward )
function: def _onnx_model_to_singa_ops(cls,
                                   graph,
                                   device,
                                   opset_version=_opset_version):
          """
          get all intermediate params, operators, and input info from onnx model
          Args:
              graph (Graph): the loaded ONNX graph
              device (string): CPU or CUDA
              opset_version (int): the opset version
          Returns:
              a dict of weights
              a dict of ValueInfo
              a dict of ValueInfo
              a list of SingaOps('node', 'forward')
          """
          # init all tensor input and params as a tensor map
          params = cls._parse_graph_params(graph, device)
          inputs, outputs = cls._parse_graph_inputs_outputs(graph, params, device)
          # the parsed operators queue
          operators = []
          operator_tuple = namedtuple('operator_tuple', ['node', 'operator'])
          for node in graph.node:
              if not node.name:
                  node.name = "%s_%d" % (str(node.op_type), len(operators))
              node = OnnxNode(node)
              # convert Constant to param
              if node.op_type == 'Constant':
                  params[node.outputs[0]] = cls._onnx_constant_to_np(node)
              else:
                  op = cls._onnx_node_to_singa_op(node, opset_version)
                  operators.append(operator_tuple(node, op))
          return params, inputs, outputs, operators
function_tokens: def _onnx_model_to_singa_ops ( cls , graph , device , opset_version = _opset_version ) : # init all tensor input and params as a tensor map params = cls . _parse_graph_params ( graph , device ) inputs , outputs = cls . _parse_graph_inputs_outputs ( graph , params , device ) # the parsed operators queue operators = [ ] operator_tuple = namedtuple ( 'operator_tuple' , [ 'node' , 'operator' ] ) for node in graph . node : if not node . name : node . name = "%s_%d" % ( str ( node . op_type ) , len ( operators ) ) node = OnnxNode ( node ) # convert Constant to param if node . op_type == 'Constant' : params [ node . outputs [ 0 ] ] = cls . _onnx_constant_to_np ( node ) else : op = cls . _onnx_node_to_singa_op ( node , opset_version ) operators . append ( operator_tuple ( node , op ) ) return params , inputs , outputs , operators