Example #1
0
        /** @copydoc LayerParameterBase::Clone */
        public override LayerParameterBase Clone()
        {
            FlattenParameter p = new FlattenParameter();

            p.Copy(this);
            return(p);
        }
Example #2
0
        /** @copydoc LayerParameterBase::Copy */
        public override void Copy(LayerParameterBase src)
        {
            FlattenParameter p = (FlattenParameter)src;

            m_nAxis    = p.m_nAxis;
            m_nEndAxis = p.m_nEndAxis;
        }
Example #3
0
        /** @copydoc LayerParameterBase::Load */
        public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
        {
            RawProto         proto = RawProto.Parse(br.ReadString());
            FlattenParameter p     = FromProto(proto);

            if (!bNewInstance)
            {
                Copy(p);
            }

            return(p);
        }
Example #4
0
        /// <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 FlattenParameter FromProto(RawProto rp)
        {
            string           strVal;
            FlattenParameter p = new FlattenParameter();

            if ((strVal = rp.FindValue("axis")) != null)
            {
                p.axis = int.Parse(strVal);
            }

            if ((strVal = rp.FindValue("end_axis")) != null)
            {
                p.end_axis = int.Parse(strVal);
            }

            return(p);
        }