# Autogenerated by onnx-model-maker. Don't modify it manually.

import onnx
import onnx.helper
import onnx.numpy_helper
from onnx_model_maker import omm
from onnx_model_maker import onnx_mm_export
from onnx_model_maker.ops.op_helper import _add_input


@onnx_mm_export("v16.LessOrEqual")
def LessOrEqual(A, B, **kwargs):
  _inputs = []
  for i in (A, B):
    _add_input(i, _inputs)

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


@onnx_mm_export("v16.ScatterND")
def ScatterND(data, indices, updates, **kwargs):
  _inputs = []
  for i in (data, indices, updates):
    _add_input(i, _inputs)

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


@onnx_mm_export("v16.ScatterElements")
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


@onnx_mm_export("v16.RoiAlign")
def RoiAlign(X, rois, batch_indices, **kwargs):
  _inputs = []
  for i in (X, rois, batch_indices):
    _add_input(i, _inputs)

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


@onnx_mm_export("v16.Scan")
def Scan(initial_state_and_scan_inputs, **kwargs):
  _inputs = []
  for i in (initial_state_and_scan_inputs, ):
    _add_input(i, _inputs)

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


@onnx_mm_export("v16.Where")
def Where(condition, X, Y, **kwargs):
  _inputs = []
  for i in (condition, X, Y):
    _add_input(i, _inputs)

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


@onnx_mm_export("v16.GreaterOrEqual")
def GreaterOrEqual(A, B, **kwargs):
  _inputs = []
  for i in (A, B):
    _add_input(i, _inputs)

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


@onnx_mm_export("v16.Loop")
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


@onnx_mm_export("v16.LeakyRelu")
def LeakyRelu(X, **kwargs):
  _inputs = []
  for i in (X, ):
    _add_input(i, _inputs)

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


@onnx_mm_export("v16.If")
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


@onnx_mm_export("v16.GridSample")
def GridSample(X, grid, **kwargs):
  _inputs = []
  for i in (X, grid):
    _add_input(i, _inputs)

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


@onnx_mm_export("v16.Identity")
def Identity(input, **kwargs):
  _inputs = []
  for i in (input, ):
    _add_input(i, _inputs)

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


@onnx_mm_export("v16.PRelu")
def PRelu(X, slope, **kwargs):
  _inputs = []
  for i in (X, slope):
    _add_input(i, _inputs)

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