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

Method __init__

python/singa/sonnx.py:1953–1975  ·  view source on GitHub ↗

https://github.com/onnx/onnx/blob/master/docs/ImplementingAnOnnxBackend.md SingaRep provides the intermediate representation of Singa, the user can run the forward of the singa model by run func, or, the user can append more layers after the singa_ops to do t

(self, params, inputs, outputs, layers, device)

Source from the content-addressed store, hash-verified

1951class SingaRep(BackendRep):
1952
1953 def __init__(self, params, inputs, outputs, layers, device):
1954 """
1955 https://github.com/onnx/onnx/blob/master/docs/ImplementingAnOnnxBackend.md
1956 SingaRep provides the intermediate representation of Singa,
1957 the user can run the forward of the singa model by run func,
1958 or, the user can append more layers after the singa_ops to do
1959 the transfer learning
1960 Args:
1961 params (dict{}): a dict of params, data type is numpy ndarray
1962 inputs (ValueInfo): a dict of inputs
1963 outputs (ValueInfo): a dict of outputs
1964 layers (namedtuple('operator_tuple', ['node', 'operator'])[]): a list of singa operator
1965 device (string): CPU or CUDA
1966 """
1967 super(SingaRep, self).__init__()
1968 self.inputs = inputs
1969 self.states = params
1970 self.outputs = outputs
1971 self.dev = cpu_dev if device == "CPU" else gpu_dev
1972 self.layers = layers
1973 self.tensor_count = {}
1974 self.has_initialized = False
1975 self.is_graph = False
1976
1977 def initialize(self):
1978 """

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected