/** @copydoc PoolingParameter::Clone */ public override LayerParameterBase Clone() { UnPoolingParameter p = new UnPoolingParameter(); p.Copy(this); 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 new UnPoolingParameter FromProto(RawProto rp) { UnPoolingParameter p = new UnPoolingParameter(); ((PoolingParameter)p).Copy(PoolingParameter.FromProto(rp)); p.m_rgUnpool = rp.FindArray <uint>("unpool_size"); p.m_nUnPoolH = (uint?)rp.FindValue("unpool_h", typeof(uint)); p.m_nUnPoolW = (uint?)rp.FindValue("unpool_w", typeof(uint)); return(p); }
/** @copydoc PoolingParameter::Copy */ public override void Copy(LayerParameterBase src) { base.Copy(src); if (src is UnPoolingParameter) { UnPoolingParameter p = (UnPoolingParameter)src; m_rgUnpool = Utility.Clone <uint>(p.m_rgUnpool); m_nUnPoolH = p.m_nUnPoolH; m_nUnPoolW = p.m_nUnPoolW; } }
/** @copydoc PoolingParameter::Load */ public override object Load(System.IO.BinaryReader br, bool bNewInstance = true) { RawProto proto = RawProto.Parse(br.ReadString()); UnPoolingParameter p = FromProto(proto) as UnPoolingParameter; if (p == null) { throw new Exception("Expected UnPoolingParameter type!"); } if (!bNewInstance) { Copy(p); } return(p); }