Example #1
0
        /// <summary>
        /// Adds an input variable to the list.
        /// </summary>
        public void AddInputVariable(ColumnType type, string colName)
        {
            _host.CheckValue(type, nameof(type));
            _host.CheckValue(colName, nameof(colName));

            colName = AddVariable(colName);
            _inputs.Add(OnnxUtils.GetModelArgs(type, colName));
        }
Example #2
0
 /// <summary>
 /// Adds an intermediate column to the list.
 /// </summary>
 public override string AddIntermediateVariable(ColumnType type, string colName, bool skip = false)
 {
     colName = AddVariable(colName);
     // Let the runtime figure the shape.
     if (!skip)
     {
         _host.CheckValue(type, nameof(type));
         _intermediateValues.Add(OnnxUtils.GetModelArgs(type, colName));
     }
     return(colName);
 }
Example #3
0
        /// <summary>
        /// Adds an output variable to the list.
        /// </summary>
        public string AddOutputVariable(ColumnType type, string colName, List <long> dim = null)
        {
            _host.CheckValue(type, nameof(type));

            if (!ContainsColumn(colName))
            {
                AddVariable(colName);
            }

            colName = GetVariableName(colName);
            _outputs.Add(OnnxUtils.GetModelArgs(type, colName, dim));
            return(colName);
        }
Example #4
0
 /// <summary>
 /// Adds an output variable to the list.
 /// </summary>
 public void AddOutputVariable(ColumnType type, string variableName, List <long> dim = null)
 {
     _host.CheckValue(type, nameof(type));
     _host.CheckParam(IsVariableDefined(variableName), nameof(variableName));
     _outputs.Add(OnnxUtils.GetModelArgs(type, variableName, dim));
 }