Esempio n. 1
0
        public override void Setup(TensorCollection bottom, TensorCollection top)
        {
            base.Setup(bottom, top);

            var bottomBlob = bottom.First();
            var topBlob    = top.First();

            topBlob.ReshapeAs(bottomBlob);

            this.cache = Vector <double> .Build.Dense(bottom[0].Count / bottom[0].Num);

            this.scaleVector = Vector <double> .Build.Dense(bottomBlob.Num);
        }
Esempio n. 2
0
        public override void Setup(TensorCollection bottom, TensorCollection top)
        {
            base.Setup(bottom, top);

            // NeuronLayer allows in-place computations. If the computation is not
            // in-place, we will need to initialize the top blob.
            var bottomBlob = bottom.First();
            var topBlob    = top.First();

            if (bottomBlob != topBlob)
            {
                topBlob.ReshapeAs(bottomBlob);
            }
        }