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

Method _create_dropout

python/singa/sonnx.py:1354–1366  ·  view source on GitHub ↗

get the Dropout 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

1352
1353 @classmethod
1354 def _create_dropout(cls, onnx_node, operator, opset_version=_opset_version):
1355 """
1356 get the Dropout operator from onnx node
1357 Args:
1358 onnx_node (OnnxNode): a given onnx node
1359 operator (Operator Class): a singa operator class
1360 opset_version (int): the opset version
1361 Returns:
1362 singa operator instance
1363 """
1364 seed = onnx_node.getattr("seed", 0)
1365 ratio = onnx_node.getattr("ratio", 0)
1366 return operator(seed, ratio)
1367
1368 @classmethod
1369 def _create_constant_of_shape(cls,

Callers

nothing calls this directly

Calls 1

getattrMethod · 0.80

Tested by

no test coverage detected