예제 #1
0
 /// <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);
예제 #2
0
 /// 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);
 }
예제 #3
0
 public override string AddInitializer(long value, string name = null)
 {
     name = AddVariable(name ?? "int64");
     _initializers.Add(OnnxUtils.MakeInt64(name, value));
     return(name);
 }
예제 #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));
 }