Пример #1
0
 /// <summary>
 /// Makes the ONNX model based on the context.
 /// </summary>
 public OnnxCSharpToProtoWrapper.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, bool makeUniqueName = true)
 {
     name = AddVariable(name ?? "float", makeUniqueName);
     _initializers.Add(OnnxUtils.MakeFloat(name, value));
     return(name);
 }
Пример #3
0
 public override string AddInitializer(long value, string name = null, bool makeUniqueName = true)
 {
     name = AddVariable(name ?? "int64", makeUniqueName);
     _initializers.Add(OnnxUtils.MakeInt64(name, value));
     return(name);
 }
Пример #4
0
 /// <summary>
 /// Adds an output variable to the list.
 /// </summary>
 public void AddOutputVariable(DataViewType 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));
 }
Пример #5
0
 public override string AddInitializer(string value, string name = null)
 {
     name = AddVariable(name ?? "string");
     _initializers.Add(OnnxUtils.MakeString(name, value));
     return(name);
 }
Пример #6
0
 public override void AddAttribute(string argName, bool value)
 => OnnxUtils.NodeAddAttributes(_node, argName, value);
Пример #7
0
 public override void AddAttribute(string argName, IEnumerable <string> value)
 => OnnxUtils.NodeAddAttributes(_node, argName, value);
Пример #8
0
 public override void AddAttribute(string argName, IEnumerable <ReadOnlyMemory <char> > value)
 => OnnxUtils.NodeAddAttributes(_node, argName, value);