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

Method _create_reduce_ops

python/singa/sonnx.py:1336–1351  ·  view source on GitHub ↗

get the ReduceSum, ReduceMean, ReduceMax, ReduceMin, etc, operator from onnx node Args: onnx_node (OnnxNode): a given onnx node operator (Operator Class): a singa operator class opset_version (int): the opset version Returns:

(cls,
                           onnx_node,
                           operator,
                           opset_version=_opset_version)

Source from the content-addressed store, hash-verified

1334
1335 @classmethod
1336 def _create_reduce_ops(cls,
1337 onnx_node,
1338 operator,
1339 opset_version=_opset_version):
1340 """
1341 get the ReduceSum, ReduceMean, ReduceMax, ReduceMin, etc, operator from onnx node
1342 Args:
1343 onnx_node (OnnxNode): a given onnx node
1344 operator (Operator Class): a singa operator class
1345 opset_version (int): the opset version
1346 Returns:
1347 singa operator instance
1348 """
1349 axes = onnx_node.getattr("axes", None)
1350 keepdims = onnx_node.getattr("keepdims", 1)
1351 return operator(axes, keepdims)
1352
1353 @classmethod
1354 def _create_dropout(cls, onnx_node, operator, opset_version=_opset_version):

Callers

nothing calls this directly

Calls 1

getattrMethod · 0.80

Tested by

no test coverage detected