Exemplo n.º 1
0
        public void cntk_equal_test()
        {
            using (var K = new CNTKBackend())
            {
                var x = K.variable(array: new double[, ] {
                    { 1, 2, 3 }, { 4, 5, 6 }
                });
                var y = K.variable(array: new double[, ] {
                    { 1, 2, 3 }, { 4, 5, 6 }
                });
                Assert.AreEqual(new bool[, ] {
                    { true, true, true }, { true, true, true }
                }, K.equal(x, y).eval <bool>());

                x = K.variable(array: new double[, ] {
                    { 1, 2, 3 }, { 4, 5, 6 }
                });
                y = K.variable(array: new double[, ] {
                    { 1, 2, 3 }, { 4, 5, 0 }
                });
                Assert.AreEqual(new bool[, ] {
                    { true, true, true }, { true, true, false }
                }, (bool[, ])K.equal(x, y).eval <bool>());
            }
        }