コード例 #1
0
        public void GenerateBatchSize()
        {
            var inputTensor = new Tensor();
            var batchSize   = 4;
            var generator   = new BatchSizeGenerator();

            generator.Generate(inputTensor, batchSize, null);
            Assert.IsNotNull(inputTensor.Data as int[]);
            Assert.AreEqual((inputTensor.Data as int[])[0], batchSize);
        }
        public void GenerateBatchSize()
        {
            var       inputTensor = new TensorProxy();
            var       alloc       = new TensorCachingAllocator();
            const int batchSize   = 4;
            var       generator   = new BatchSizeGenerator(alloc);

            generator.Generate(inputTensor, batchSize, null);
            Assert.IsNotNull(inputTensor.data);
            Assert.AreEqual(inputTensor.data[0], batchSize);
            alloc.Dispose();
        }