/** @copydoc LayerParameterBase::Copy */ public override void Copy(LayerParameterBase src) { InputParameter p = (InputParameter)src; m_rgShape = new List <param.BlobShape>(); foreach (BlobShape b in p.shape) { m_rgShape.Add(b.Clone()); } }
/** @copydoc LayerParameterBase::Load */ public override object Load(BinaryReader br, bool bNewInstance = true) { RawProto proto = RawProto.Parse(br.ReadString()); InputParameter p = FromProto(proto); if (!bNewInstance) { Copy(p); } return(p); }
/// <summary> /// Parses the parameter from a RawProto. /// </summary> /// <param name="rp">Specifies the RawProto to parse.</param> /// <returns>A new instance of the parameter is returned.</returns> public static InputParameter FromProto(RawProto rp) { InputParameter p = new InputParameter(); RawProtoCollection col = rp.FindChildren("shape"); foreach (RawProto rp1 in col) { BlobShape b = BlobShape.FromProto(rp1); p.m_rgShape.Add(b); } return(p); }