2using System.Collections.Generic;
16 List<int> m_rgDim =
new List<int>();
34 m_rgDim =
new List<int>() { nNum, nC, nH, nW };
43 m_rgDim =
new List<int>();
45 for (
int i = 0; i < rgShape.Count; i++)
47 m_rgDim.Add(rgShape[i]);
55 public void Save(BinaryWriter bw)
66 public object Load(BinaryReader br,
bool bNewInstance)
73 b.m_rgDim =
Utility.Load<
int>(br);
94 get {
return m_rgDim; }
95 set { m_rgDim =
new List<int>(value); }
106 bs.m_rgDim =
Utility.Clone<
int>(m_rgDim);
115 object ICloneable.
Clone()
127 return Utility.Compare<
int>(m_rgDim, bs.m_rgDim);
157 rgChildren.
Add<
int>(
"dim", m_rgDim);
159 return new RawProto(strName,
"", rgChildren);
169 return new BlobShape(rp.FindArray<
int>(
"dim"));
180 for (
int i = 0; i < m_rgDim.Count; i++)
182 strOut += m_rgDim[i].ToString();
186 strOut = strOut.TrimEnd(
',');
The BaseParameter class is the base class for all other parameter classes.
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.
The Utility class provides general utility funtions.
static void Save(BinaryWriter bw, List< double > rg)
Save a list of double to a binary writer.
Specifies the shape of a Blob.
override string ToString()
Return the string representation of the shape.
BlobShape(int nNum, int nC, int nH, int nW)
The BlobShape constructor.
override RawProto ToProto(string strName)
Converts the BlobShape to a RawProto.
bool Compare(BlobShape bs)
Compares this BlobShape to another.
BlobShape Clone()
Creates a copy of the BlobShape.
static BlobShape FromProto(RawProto rp)
Parse a new BlobShape from a RawProto.
BlobShape()
The BlobShape constructor.
object Load(BinaryReader br, bool bNewInstance)
Load the BlobShape from a binary reader.
List< int > dim
The blob shape dimensions.
static BlobShape Load(BinaryReader br)
Load the BlobShape from a binary reader.
int CompareTo(object obj)
Compares this BlobShape to another.
void Save(BinaryWriter bw)
Save the BlobShape to a binary writer.
BlobShape(List< int > rgShape)
The BlobShape constructor.
The IBinaryPersist interface provides generic save and load functionality.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.common namespace contains common MyCaffe classes.
The MyCaffe.param namespace contains parameters used to create models.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...