MCPcopy Create free account
hub / github.com/apache/singa / singa_to_onnx_model

Method singa_to_onnx_model

python/singa/sonnx.py:968–987  ·  view source on GitHub ↗

get onnx model from singa computational graph Args: inputs: a list of input tensors (each is initialized with a name) Args: y: a list of tensors, usually the outputs of the graph Returns: the onnx model

(cls, inputs, y, model_name="sonnx")

Source from the content-addressed store, hash-verified

966
967 @classmethod
968 def singa_to_onnx_model(cls, inputs, y, model_name="sonnx"):
969 """
970 get onnx model from singa computational graph
971 Args:
972 inputs: a list of input tensors (each is initialized with a name)
973 Args:
974 y: a list of tensors, usually the outputs of the graph
975 Returns:
976 the onnx model
977 """
978 opset_id = OperatorSetIdProto()
979 opset_id.version = cls._target_opset_version
980 model = helper.make_model(cls.singa_to_onnx_graph(inputs,
981 y,
982 model_name="sonnx"),
983 producer_name='sonnx',
984 opset_imports=[opset_id])
985 model = optimizer.optimize(model)
986 checker.check_model(model)
987 return model
988
989
990class OnnxNode(object):

Callers

nothing calls this directly

Calls 1

singa_to_onnx_graphMethod · 0.80

Tested by

no test coverage detected