Esempio n. 1
0
        /// <summary>ブロードキャスト</summary>
        public static VariableNode Broadcast(VariableNode x, Shape shape)
        {
            while (!((int[])x.Shape).SequenceEqual((int[])shape))
            {
                Function function = new Functions.ArrayManipulation.Broadcast(x.Shape, shape);

                x = Apply(function, x)[0];
            }

            return(x);
        }
Esempio n. 2
0
        /// <summary>ブロードキャスト</summary>
        public static Tensor Broadcast(Tensor x, Shape shape)
        {
            while (!((int[])x.Shape).SequenceEqual((int[])shape))
            {
                Function function = new Functions.ArrayManipulation.Broadcast(x.Shape, shape);

                Tensor y = new Tensor(shape);

                function.Execute(new Tensor[] { x }, new Tensor[] { y });

                x = y;
            }

            return(x);
        }