{#
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to you under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 #}
{%- macro parameter_description() -%}
# {{ "%-15.15s" | format("NAME") }} {{ "%-8.8s" | format("TYPE") }} {{ "%-12.12s" | format("VALUE_TYPE") }} {{ "%-8.8s" | format("SHAPE") }} {{ "%-10s" | format("MEANING") }}
{%- endmacro -%}

{% import 'util.dml.jinja' as util %}
{%- if graph_function_description != "" -%} # {{ graph_function_description + "\n" }} {%- endif -%}
{%- if function_inputs | length > 0 -%}
# --------------------------------------------------------------------------------------------
# INPUT PARAMETERS:
# --------------------------------------------------------------------------------------------
{{ parameter_description() }}
{% for input in function_inputs -%}
# {{ "%-15.15s" | format(input.identifier_name) }} {{ "%-8.8s" | format(input.data_type,) }} {{ "%-12.12s" | format(input.value_type,) }} {{ "%-8.8s" | format(input.shape,) }} {{ "%-10s" | format(input.description,) }}
{% endfor -%}
{%- endif %}
{%- if function_outputs | length > 0 -%}
# ---------------------------------------------------------------------------------------------
# OUTPUTS:
# ---------------------------------------------------------------------------------------------
{{ parameter_description() }}
{% for output in function_outputs -%}
# {{ "%-15.15s" | format(output.identifier_name) }} {{ "%-8.8s" | format(output.data_type,) }} {{ "%-12.12s" | format(output.value_type,) }} {{ "%-8.8s" | format(output.shape,) }} {{ "%-10s" | format(output.description,) }}
{% endfor -%}
# ---------------------------------------------------------------------------------------------
{%- endif %}
{{ graph_function_name }} = function(
{{ util.generate_call_list(function_inputs) }}
)
return (
{{ util.generate_call_list(function_outputs) }}
) {
{%- for initializer in function_start_initializers %}
  {{ util.initialize_variable(initializer) }}
{% endfor %}
{% for node_script in node_scripts -%}
{{ node_script | indent(4, first=true) }}
{% endfor -%}
}