Esempio n. 1
0
def Sum(data_0, **kwargs):
  _inputs = []
  for i in (data_0, ):
    _add_input(i, _inputs)

  idx = omm.op_counter["Sum"]
  omm.op_counter["Sum"] += 1
  node = onnx.helper.make_node("Sum",
                               _inputs, [f'_t_Sum_{idx}_sum'],
                               name=f"Sum_{idx}",
                               **kwargs)
  onnx.checker.check_node(node, omm.ctx)
  omm.model.graph.node.append(node)
  return node
Esempio n. 2
0
def Equal(A, B, **kwargs):
    _inputs = []
    for i in (A, B):
        _add_input(i, _inputs)

    idx = omm.op_counter["Equal"]
    omm.op_counter["Equal"] += 1
    node = onnx.helper.make_node("Equal",
                                 _inputs, [f'_t_Equal_{idx}_C'],
                                 name=f"Equal_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 3
0
def Det(X, **kwargs):
    _inputs = []
    for i in (X, ):
        _add_input(i, _inputs)

    idx = omm.op_counter["Det"]
    omm.op_counter["Det"] += 1
    node = onnx.helper.make_node("Det",
                                 _inputs, [f'_t_Det_{idx}_Y'],
                                 name=f"Det_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 4
0
def Clip(input, min=None, max=None, **kwargs):
    _inputs = []
    for i in (input, min, max):
        _add_input(i, _inputs)

    idx = omm.op_counter["Clip"]
    omm.op_counter["Clip"] += 1
    node = onnx.helper.make_node("Clip",
                                 _inputs, [f'_t_Clip_{idx}_output'],
                                 name=f"Clip_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 5
0
def Resize(X, roi, scales, sizes=None, **kwargs):
    _inputs = []
    for i in (X, roi, scales, sizes):
        _add_input(i, _inputs)

    idx = omm.op_counter["Resize"]
    omm.op_counter["Resize"] += 1
    node = onnx.helper.make_node("Resize",
                                 _inputs, [f'_t_Resize_{idx}_Y'],
                                 name=f"Resize_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 6
0
def Conv(X, W, B=None, **kwargs):
    _inputs = []
    for i in (X, W, B):
        _add_input(i, _inputs)

    idx = omm.op_counter["Conv"]
    omm.op_counter["Conv"] += 1
    node = onnx.helper.make_node("Conv",
                                 _inputs, [f'_t_Conv_{idx}_Y'],
                                 name=f"Conv_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 7
0
def SequenceEmpty(**kwargs):
    _inputs = []
    for i in ():
        _add_input(i, _inputs)

    idx = omm.op_counter["SequenceEmpty"]
    omm.op_counter["SequenceEmpty"] += 1
    node = onnx.helper.make_node("SequenceEmpty",
                                 _inputs, [f'_t_SequenceEmpty_{idx}_output'],
                                 name=f"SequenceEmpty_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 8
0
def Gemm(A, B, C=None, **kwargs):
    _inputs = []
    for i in (A, B, C):
        _add_input(i, _inputs)

    idx = omm.op_counter["Gemm"]
    omm.op_counter["Gemm"] += 1
    node = onnx.helper.make_node("Gemm",
                                 _inputs, [f'_t_Gemm_{idx}_Y'],
                                 name=f"Gemm_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 9
0
def ScatterElements(data, indices, updates, **kwargs):
    _inputs = []
    for i in (data, indices, updates):
        _add_input(i, _inputs)

    idx = omm.op_counter["ScatterElements"]
    omm.op_counter["ScatterElements"] += 1
    node = onnx.helper.make_node("ScatterElements",
                                 _inputs, [f'_t_ScatterElements_{idx}_output'],
                                 name=f"ScatterElements_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 10
0
def SoftmaxCrossEntropyLoss(scores, labels, weights=None, **kwargs):
  _inputs = []
  for i in (scores, labels, weights):
    _add_input(i, _inputs)

  idx = omm.op_counter["SoftmaxCrossEntropyLoss"]
  omm.op_counter["SoftmaxCrossEntropyLoss"] += 1
  node = onnx.helper.make_node("SoftmaxCrossEntropyLoss",
                               _inputs, [f'_t_SoftmaxCrossEntropyLoss_{idx}_output', f'_t_SoftmaxCrossEntropyLoss_{idx}_log_prob'],
                               name=f"SoftmaxCrossEntropyLoss_{idx}",
                               **kwargs)
  onnx.checker.check_node(node, omm.ctx)
  omm.model.graph.node.append(node)
  return node
Esempio n. 11
0
def MeanVarianceNormalization(X, **kwargs):
  _inputs = []
  for i in (X, ):
    _add_input(i, _inputs)

  idx = omm.op_counter["MeanVarianceNormalization"]
  omm.op_counter["MeanVarianceNormalization"] += 1
  node = onnx.helper.make_node("MeanVarianceNormalization",
                               _inputs, [f'_t_MeanVarianceNormalization_{idx}_Y'],
                               name=f"MeanVarianceNormalization_{idx}",
                               **kwargs)
  onnx.checker.check_node(node, omm.ctx)
  omm.model.graph.node.append(node)
  return node
Esempio n. 12
0
def Loop(M, cond, v_initial=None, **kwargs):
  _inputs = []
  for i in (M, cond, v_initial):
    _add_input(i, _inputs)

  idx = omm.op_counter["Loop"]
  omm.op_counter["Loop"] += 1
  node = onnx.helper.make_node("Loop",
                               _inputs, [f'_t_Loop_{idx}_v_final_and_scan_outputs'],
                               name=f"Loop_{idx}",
                               **kwargs)
  onnx.checker.check_node(node, omm.ctx)
  omm.model.graph.node.append(node)
  return node
Esempio n. 13
0
def QuantizeLinear(x, y_scale, y_zero_point=None, **kwargs):
  _inputs = []
  for i in (x, y_scale, y_zero_point):
    _add_input(i, _inputs)

  idx = omm.op_counter["QuantizeLinear"]
  omm.op_counter["QuantizeLinear"] += 1
  node = onnx.helper.make_node("QuantizeLinear",
                               _inputs, [f'_t_QuantizeLinear_{idx}_y'],
                               name=f"QuantizeLinear_{idx}",
                               **kwargs)
  onnx.checker.check_node(node, omm.ctx)
  omm.model.graph.node.append(node)
  return node
Esempio n. 14
0
def NegativeLogLikelihoodLoss(input, target, weight=None, **kwargs):
  _inputs = []
  for i in (input, target, weight):
    _add_input(i, _inputs)

  idx = omm.op_counter["NegativeLogLikelihoodLoss"]
  omm.op_counter["NegativeLogLikelihoodLoss"] += 1
  node = onnx.helper.make_node("NegativeLogLikelihoodLoss",
                               _inputs, [f'_t_NegativeLogLikelihoodLoss_{idx}_loss'],
                               name=f"NegativeLogLikelihoodLoss_{idx}",
                               **kwargs)
  onnx.checker.check_node(node, omm.ctx)
  omm.model.graph.node.append(node)
  return node
Esempio n. 15
0
def Pad(data, pads, constant_value=None, **kwargs):
    _inputs = []
    for i in (data, pads, constant_value):
        _add_input(i, _inputs)

    idx = omm.op_counter["Pad"]
    omm.op_counter["Pad"] += 1
    node = onnx.helper.make_node("Pad",
                                 _inputs, [f'_t_Pad_{idx}_output'],
                                 name=f"Pad_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 16
0
def CumSum(x, axis, **kwargs):
    _inputs = []
    for i in (x, axis):
        _add_input(i, _inputs)

    idx = omm.op_counter["CumSum"]
    omm.op_counter["CumSum"] += 1
    node = onnx.helper.make_node("CumSum",
                                 _inputs, [f'_t_CumSum_{idx}_y'],
                                 name=f"CumSum_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 17
0
def Slice(data, starts, ends, axes=None, steps=None, **kwargs):
    _inputs = []
    for i in (data, starts, ends, axes, steps):
        _add_input(i, _inputs)

    idx = omm.op_counter["Slice"]
    omm.op_counter["Slice"] += 1
    node = onnx.helper.make_node("Slice",
                                 _inputs, [f'_t_Slice_{idx}_output'],
                                 name=f"Slice_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 18
0
def Range(start, limit, delta, **kwargs):
    _inputs = []
    for i in (start, limit, delta):
        _add_input(i, _inputs)

    idx = omm.op_counter["Range"]
    omm.op_counter["Range"] += 1
    node = onnx.helper.make_node("Range",
                                 _inputs, [f'_t_Range_{idx}_output'],
                                 name=f"Range_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 19
0
def Unsqueeze(data, **kwargs):
    _inputs = []
    for i in (data, ):
        _add_input(i, _inputs)

    idx = omm.op_counter["Unsqueeze"]
    omm.op_counter["Unsqueeze"] += 1
    node = onnx.helper.make_node("Unsqueeze",
                                 _inputs, [f'_t_Unsqueeze_{idx}_expanded'],
                                 name=f"Unsqueeze_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 20
0
def SequenceAt(input_sequence, position, **kwargs):
    _inputs = []
    for i in (input_sequence, position):
        _add_input(i, _inputs)

    idx = omm.op_counter["SequenceAt"]
    omm.op_counter["SequenceAt"] += 1
    node = onnx.helper.make_node("SequenceAt",
                                 _inputs, [f'_t_SequenceAt_{idx}_tensor'],
                                 name=f"SequenceAt_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 21
0
def If(cond, **kwargs):
    _inputs = []
    for i in (cond, ):
        _add_input(i, _inputs)

    idx = omm.op_counter["If"]
    omm.op_counter["If"] += 1
    node = onnx.helper.make_node("If",
                                 _inputs, [f'_t_If_{idx}_outputs'],
                                 name=f"If_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 22
0
def OneHot(indices, depth, values, **kwargs):
    _inputs = []
    for i in (indices, depth, values):
        _add_input(i, _inputs)

    idx = omm.op_counter["OneHot"]
    omm.op_counter["OneHot"] += 1
    node = onnx.helper.make_node("OneHot",
                                 _inputs, [f'_t_OneHot_{idx}_output'],
                                 name=f"OneHot_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 23
0
def Gather(data, indices, **kwargs):
    _inputs = []
    for i in (data, indices):
        _add_input(i, _inputs)

    idx = omm.op_counter["Gather"]
    omm.op_counter["Gather"] += 1
    node = onnx.helper.make_node("Gather",
                                 _inputs, [f'_t_Gather_{idx}_output'],
                                 name=f"Gather_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 24
0
def MaxUnpool(X, I, output_shape=None, **kwargs):
    _inputs = []
    for i in (X, I, output_shape):
        _add_input(i, _inputs)

    idx = omm.op_counter["MaxUnpool"]
    omm.op_counter["MaxUnpool"] += 1
    node = onnx.helper.make_node("MaxUnpool",
                                 _inputs, [f'_t_MaxUnpool_{idx}_output'],
                                 name=f"MaxUnpool_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 25
0
def Constant(**kwargs):
    _inputs = []
    for i in ():
        _add_input(i, _inputs)

    idx = omm.op_counter["Constant"]
    omm.op_counter["Constant"] += 1
    node = onnx.helper.make_node("Constant",
                                 _inputs, [f'_t_Constant_{idx}_output'],
                                 name=f"Constant_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 26
0
def Softmax(input, **kwargs):
    _inputs = []
    for i in (input, ):
        _add_input(i, _inputs)

    idx = omm.op_counter["Softmax"]
    omm.op_counter["Softmax"] += 1
    node = onnx.helper.make_node("Softmax",
                                 _inputs, [f'_t_Softmax_{idx}_output'],
                                 name=f"Softmax_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 27
0
def ReduceMean(data, **kwargs):
    _inputs = []
    for i in (data, ):
        _add_input(i, _inputs)

    idx = omm.op_counter["ReduceMean"]
    omm.op_counter["ReduceMean"] += 1
    node = onnx.helper.make_node("ReduceMean",
                                 _inputs, [f'_t_ReduceMean_{idx}_reduced'],
                                 name=f"ReduceMean_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 28
0
def SequenceLength(input_sequence, **kwargs):
    _inputs = []
    for i in (input_sequence, ):
        _add_input(i, _inputs)

    idx = omm.op_counter["SequenceLength"]
    omm.op_counter["SequenceLength"] += 1
    node = onnx.helper.make_node("SequenceLength",
                                 _inputs, [f'_t_SequenceLength_{idx}_length'],
                                 name=f"SequenceLength_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 29
0
def DepthToSpace(input, **kwargs):
    _inputs = []
    for i in (input, ):
        _add_input(i, _inputs)

    idx = omm.op_counter["DepthToSpace"]
    omm.op_counter["DepthToSpace"] += 1
    node = onnx.helper.make_node("DepthToSpace",
                                 _inputs, [f'_t_DepthToSpace_{idx}_output'],
                                 name=f"DepthToSpace_{idx}",
                                 **kwargs)
    onnx.checker.check_node(node, omm.ctx)
    omm.model.graph.node.append(node)
    return node
Esempio n. 30
0
def Transpose(data, **kwargs):
  _inputs = []
  for i in (data, ):
    _add_input(i, _inputs)

  idx = omm.op_counter["Transpose"]
  omm.op_counter["Transpose"] += 1
  node = onnx.helper.make_node("Transpose",
                               _inputs, [f'_t_Transpose_{idx}_transposed'],
                               name=f"Transpose_{idx}",
                               **kwargs)
  onnx.checker.check_node(node, omm.ctx)
  omm.model.graph.node.append(node)
  return node