Exemplo n.º 1
0
        private static OnnxCSharpToProtoWrapper.AttributeProto MakeAttribute(string key, IEnumerable <OnnxCSharpToProtoWrapper.GraphProto> value)
        {
            Contracts.CheckValue(value, nameof(value));

            OnnxCSharpToProtoWrapper.AttributeProto attribute = MakeAttribute(key);
            attribute.Type = OnnxCSharpToProtoWrapper.AttributeProto.Types.AttributeType.Graphs;
            attribute.Graphs.Add(value);
            return(attribute);
        }
Exemplo n.º 2
0
        private static OnnxCSharpToProtoWrapper.AttributeProto MakeAttribute(string key)
        {
            Contracts.CheckNonEmpty(key, nameof(key));

            var attribute = new OnnxCSharpToProtoWrapper.AttributeProto();

            attribute.Name = key;
            return(attribute);
        }
Exemplo n.º 3
0
        private static OnnxCSharpToProtoWrapper.AttributeProto MakeAttribute(string key, IEnumerable <double> value)
        {
            Contracts.CheckValue(value, nameof(value));

            OnnxCSharpToProtoWrapper.AttributeProto attribute = MakeAttribute(key);
            attribute.Type = OnnxCSharpToProtoWrapper.AttributeProto.Types.AttributeType.Floats;
            attribute.Floats.Add(value.Select(x => (float)x));
            return(attribute);
        }