Пример #1
0
        public void Concat_AxisOutOfrangeCase1_ThrowException()
        {
            // arrange
            const int ConcatAxis = 3;
            var       inputs     = new NdArray <int>[] { NdArray <int> .Zeros(HostDevice.Instance, new[] { 1, 1 }) };

            // action
            NdArrayOperator <int> .Concat(ConcatAxis, inputs);
        }
Пример #2
0
        public void Concat_EmptyInput_ThrowException()
        {
            // arrange
            const int DummyAxis   = 1;
            var       emptyInputs = new NdArray <int>[] { };

            // action
            NdArrayOperator <int> .Concat(DummyAxis, emptyInputs);
        }
Пример #3
0
        public void Concat_DifferntShapes_ThrowException()
        {
            // arrange
            const int ConcatAxis = 1;
            var       inputs     = new NdArray <int>[]
            {
                NdArray <int> .Zeros(HostDevice.Instance, new[] { 1, 1 }),
                NdArray <int> .Zeros(HostDevice.Instance, new[] { 2, 1 })
            };

            // action
            NdArrayOperator <int> .Concat(ConcatAxis, inputs);
        }
Пример #4
0
        public void Concat()
        {
            // arrange
            const int ConcatAxis = 1;
            var       inputs     = new NdArray <int>[]
            {
                NdArray <int> .Zeros(HostDevice.Instance, new[] { 4, 28 }),
                NdArray <int> .Zeros(HostDevice.Instance, new[] { 4, 15 }),
                NdArray <int> .Zeros(HostDevice.Instance, new[] { 4, 10 })
            };

            // action
            var concat = NdArrayOperator <int> .Concat(ConcatAxis, inputs);

            // assert
            CollectionAssert.AreEqual(new[] { 4, 53 }, concat.Shape);
        }