Esempio n. 1
0
        public void Cos_()
        {
            float[] data1  = { 0.4f, 0.5f, 0.3f, -0.1f };
            int[]   shape1 = { 4 };
            var     tensor = new FloatTensor(data1, shape1);

            float[] data2             = { 0.92106099f, 0.87758256f, 0.95533649f, 0.99500417f };
            int[]   shape2            = { 4 };
            var     expectedCosTensor = new FloatTensor(data2, shape2);

            tensor.Cos_();

            for (int i = 2; i < tensor.Size; i++)
            {
                Assert.AreEqual(expectedCosTensor.Data[i], tensor.Data[i]);
            }
        }