/// <summary> /// Makes the ONNX model based on the context. /// </summary> public ModelProto MakeModel() => OnnxUtils.MakeModel(_nodes, _producerName, _name, _domain, _producerVersion, _modelVersion, _inputs, _outputs, _intermediateValues, _initializers);
/// Adds constant tensor into the graph. public override string AddInitializer(float value, string name = null) { name = AddVariable(name ?? "float"); _initializers.Add(OnnxUtils.MakeFloat(name, value)); return(name); }
public override string AddInitializer(long value, string name = null) { name = AddVariable(name ?? "int64"); _initializers.Add(OnnxUtils.MakeInt64(name, value)); return(name); }
/// <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)); }