/** @copydoc LayerParameterBase::Clone */ public override LayerParameterBase Clone() { BiasParameter p = new BiasParameter(); p.Copy(this); return(p); }
/** @copydoc LayerParameterBase::Load */ public override object Load(System.IO.BinaryReader br, bool bNewInstance = true) { RawProto proto = RawProto.Parse(br.ReadString()); BiasParameter p = FromProto(proto); if (!bNewInstance) { Copy(p); } return(p); }
/** @copydoc LayerParameterBase::Copy */ public override void Copy(LayerParameterBase src) { BiasParameter p = (BiasParameter)src; m_nAxis = p.m_nAxis; m_nNumAxes = p.m_nNumAxes; if (p.m_filler != null) { m_filler = p.m_filler.Clone(); } else { m_filler = null; } }
/// <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 BiasParameter FromProto(RawProto rp) { string strVal; BiasParameter p = new BiasParameter(); if ((strVal = rp.FindValue("axis")) != null) { p.axis = int.Parse(strVal); } if ((strVal = rp.FindValue("num_axes")) != null) { p.num_axes = int.Parse(strVal); } if ((rp = rp.FindChild("filler")) != null) { p.m_filler = FillerParameter.FromProto(rp); } return(p); }