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

Method to_output_tensor

python/singa/sonnx.py:2031–2045  ·  view source on GitHub ↗

convert the tensors to input Args: x (np.ndarray[]): a list of numpy ndarray as inputs Returns: a dict of SINGA Tensors

(self, y, out_name)

Source from the content-addressed store, hash-verified

2029 return tensor_dict
2030
2031 def to_output_tensor(self, y, out_name):
2032 """
2033 convert the tensors to input
2034 Args:
2035 x (np.ndarray[]): a list of numpy ndarray as inputs
2036 Returns:
2037 a dict of SINGA Tensors
2038 """
2039 if not self.is_graph:
2040 y = tensor.to_numpy(y)
2041 if out_name in self.outputs_info:
2042 np_dtyp = mapping.TENSOR_TYPE_TO_NP_TYPE[
2043 self.outputs_info[out_name].dtype]
2044 y = y.astype(np_dtyp)
2045 return y
2046
2047 def get_s(self, name, node, tensor_dict):
2048 """

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected