public override void AddAttribute(string argName, bool value)
 => OnnxUtils.NodeAddAttributes(_node, argName, value);
 public override void AddAttribute(string argName, IEnumerable <ReadOnlyMemory <char> > value)
 => OnnxUtils.NodeAddAttributes(_node, argName, value);
 public override void AddAttribute(string argName, IEnumerable <string> value)
 => OnnxUtils.NodeAddAttributes(_node, argName, value);
示例#4
0
 public override string AddInitializer(long value, string name = null)
 {
     name = AddVariable(name ?? "int64");
     _initializers.Add(OnnxUtils.MakeInt64(name, value));
     return(name);
 }
示例#5
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);
示例#6
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));
 }
示例#7
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);
 }
 /// <summary>
 /// Makes the ONNX model based on the context.
 /// </summary>
 public OnnxCSharpToProtoWrapper.ModelProto MakeModel()
 => OnnxUtils.MakeModel(_nodes, _producerName, _name, _domain, _producerVersion, _modelVersion, _opSetVersion, _inputs, _outputs, _intermediateValues, _initializers);
 public override string AddInitializer(ulong value, bool isUint64, string name = null, bool makeUniqueName = true)
 {
     name = AddVariable(name ?? "uint64", makeUniqueName);
     _initializers.Add(OnnxUtils.MakeUInt(name, isUint64, value));
     return(name);
 }
 public override string AddInitializer(double value, string name = null, bool makeUniqueName = true)
 {
     name = AddVariable(name ?? "double", makeUniqueName);
     _initializers.Add(OnnxUtils.MakeDouble(name, value));
     return(name);
 }
 public override string AddInitializer(int value, Type type, string name = null, bool makeUniqueName = true)
 {
     name = AddVariable(name ?? "int32", makeUniqueName);
     _initializers.Add(OnnxUtils.MakeInt32(name, type, value));
     return(name);
 }
 /// Adds constant tensor into the graph.
 public override string AddInitializer(bool value, string name = null, bool makeUniqueName = true)
 {
     name = AddVariable(name ?? "bool", makeUniqueName);
     _initializers.Add(OnnxUtils.MakeInt32(name, typeof(bool), value ? 1 : 0));
     return(name);
 }