Example #1
0
 public void MergeFrom(Layer other)
 {
     if (other == null)
     {
         return;
     }
     if (other.LayerInputDim != 0)
     {
         LayerInputDim = other.LayerInputDim;
     }
     if (other.LayerOutputDim != 0)
     {
         LayerOutputDim = other.LayerOutputDim;
     }
     if (other.layerInputWeight_ != null)
     {
         if (layerInputWeight_ == null)
         {
             layerInputWeight_ = new global::Apollo.Prediction.Matrix();
         }
         LayerInputWeight.MergeFrom(other.LayerInputWeight);
     }
     if (other.layerBias_ != null)
     {
         if (layerBias_ == null)
         {
             layerBias_ = new global::Apollo.Prediction.Vector();
         }
         LayerBias.MergeFrom(other.LayerBias);
     }
     if (other.LayerActivationFunc != 0)
     {
         LayerActivationFunc = other.LayerActivationFunc;
     }
 }
Example #2
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    input.SkipLastField();
                    break;

                case 8: {
                    LayerInputDim = input.ReadInt32();
                    break;
                }

                case 16: {
                    LayerOutputDim = input.ReadInt32();
                    break;
                }

                case 26: {
                    if (layerInputWeight_ == null)
                    {
                        layerInputWeight_ = new global::Apollo.Prediction.Matrix();
                    }
                    input.ReadMessage(layerInputWeight_);
                    break;
                }

                case 34: {
                    if (layerBias_ == null)
                    {
                        layerBias_ = new global::Apollo.Prediction.Vector();
                    }
                    input.ReadMessage(layerBias_);
                    break;
                }

                case 40: {
                    layerActivationFunc_ = (global::Apollo.Prediction.Layer.Types.ActivationFunc)input.ReadEnum();
                    break;
                }
                }
            }
        }