MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
PythonParameter.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
6using MyCaffe.basecode;
7
9{
17 [Serializable]
18 [TypeConverter(typeof(ExpandableObjectConverter))]
20 {
21 string m_strPythonPath = "$Default$";
22
25 {
26 }
27
37 [Description("Specifies the path to the Python runtime.")]
38 public string python_path
39 {
40 get { return m_strPythonPath; }
41 set { m_strPythonPath = value; }
42 }
43
45 public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
46 {
47 RawProto proto = RawProto.Parse(br.ReadString());
48 PythonParameter p = FromProto(proto);
49
50 if (!bNewInstance)
51 Copy(p);
52
53 return p;
54 }
55
57 public override void Copy(LayerParameterBase src)
58 {
60 m_strPythonPath = p.m_strPythonPath;
61 }
62
64 public override LayerParameterBase Clone()
65 {
67 p.Copy(this);
68 return p;
69 }
70
76 public override RawProto ToProto(string strName)
77 {
78 RawProtoCollection rgChildren = new RawProtoCollection();
79
80 rgChildren.Add("python_path", python_path);
81
82 return new RawProto(strName, "", rgChildren);
83 }
84
91 {
92 string strVal;
94
95 if ((strVal = rp.FindValue("python_path")) != null)
96 p.python_path = strVal;
97
98 return p;
99 }
100 }
101}
The RawProtoCollection class is a list of RawProto objects.
void Add(RawProto p)
Adds a RawProto to the collection.
The RawProto class is used to parse and output Google prototxt file data.
Definition: RawProto.cs:17
static RawProto Parse(string str)
Parses a prototxt and places it in a new RawProto.
Definition: RawProto.cs:306
string FindValue(string strName)
Searches for a falue of a node within this nodes children.
Definition: RawProto.cs:105
The LayerParameterBase is the base class for all other layer specific parameters.
Specifies the parameters for the PythonLayer.
override object Load(System.IO.BinaryReader br, bool bNewInstance=true)
Load the parameter from a binary reader.
static PythonParameter FromProto(RawProto rp)
Parses the parameter from a RawProto.
string python_path
Specifies the path to the Python runtime.
override LayerParameterBase Clone()
Creates a new copy of this instance of the parameter.
override void Copy(LayerParameterBase src)
Copy on parameter to another.
override RawProto ToProto(string strName)
Convert the parameter into a RawProto.
PythonParameter()
Constructor for the parameter.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
Definition: Annotation.cs:12
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...
Definition: Annotation.cs:12