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

Method _create_gather

python/singa/sonnx.py:1552–1564  ·  view source on GitHub ↗

get the Gather 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: singa operator instance

(cls, onnx_node, operator, opset_version=_opset_version)

Source from the content-addressed store, hash-verified

1550
1551 @classmethod
1552 def _create_gather(cls, onnx_node, operator, opset_version=_opset_version):
1553 """
1554 get the Gather operator from onnx node
1555 Args:
1556 onnx_node (OnnxNode): a given onnx node
1557 operator (Operator Class): a singa operator class
1558 opset_version (int): the opset version
1559 Returns:
1560 singa operator instance
1561 """
1562 axis = onnx_node.getattr("axis", 0)
1563 onnx_node.set_attr_inputs(onnx_node.inputs[1], 'indices')
1564 return operator(axis, None)
1565
1566 @classmethod
1567 def _create_reshape(cls, onnx_node, operator, opset_version=_opset_version):

Callers

nothing calls this directly

Calls 2

getattrMethod · 0.80
set_attr_inputsMethod · 0.80

Tested by

no test coverage detected