code: def _arithm_op(name, *inputs):
      """
      Create arguments for ArithmeticGenericOp and call it with supplied inputs.
      Select the `gpu` device if at least one of the inputs is `gpu`, otherwise `cpu`.
      """
      import nvidia.dali.ops  # Allow for late binding of the ArithmeticGenericOp from parent module.
  
      categories_idxs, edges, integers, reals = _group_inputs(inputs)
      input_desc = _generate_input_desc(
          categories_idxs, integers, reals
      )
      expression_desc = "{}({})".format(name, input_desc)
      dev = nvidia.dali.ops._choose_device(edges)
      # Create "instance" of operator
      op = nvidia.dali.ops.ArithmeticGenericOp(
          device=dev,
          expression_desc=expression_desc,
          integer_constants=integers,
          real_constants=reals,
      )
      # If we are on gpu, we must mark all inputs as gpu
      if dev == "gpu":
          dev_inputs = list(edge.gpu() for edge in edges)
      else:
          dev_inputs = edges
  
      # Call it immediately
      result = op(*dev_inputs)
      if _conditionals.conditionals_enabled():
          _conditionals.register_data_nodes(result, dev_inputs)
      return result
  
file_path: DALI/dali/python/nvidia/dali/ops/_operators/math.py
imports: from nvidia.dali import _conditionals
  from nvidia.dali.data_node import DataNode
  from nvidia.dali.types import DALIDataType, Constant, ScalarConstant, _bool_types, _int_like_types, _float_types
label_desc: Use image node_id 7 for calling a global function with example usage: _arithm_op(name) and returns: result