Livt packages
Livt.ML
Version 1.6.1
Fixed-size quantized inference, tensor storage, attention, and transformer building blocks for Livt.
Published files (132)
- DotProductTest.lvt
- Int8BroadcastMac64x8Test.lvt
- Int8Dot64x8Test.lvt
- Int8Linear4x8Test.lvt
- Int8Linear8x3Test.lvt
- Int8LinearAccumulatorTest.lvt
- Int8Mac8Test.lvt
- Int8MatrixAccumulator32StreamTest.lvt
- Int8MatrixAccumulator32Test.lvt
- Linear8x8Test.lvt
- MatrixVectorMultiplicationTest.lvt
- QLinearMatMul256x10RamTest.lvt
- QLinearMatMul256x10StreamTest.lvt
- QuantizedMatrixGroupingTest.lvt
- VecAddTest.lvt
tests/linear/Int8LinearAccumulatorTest.lvt
namespace Livt.ML.Tests.Linear
using Livt.ML.Linear
/**
* Exercises Int8LinearAccumulator with a shared fixture instance. Each scenario
* establishes the inputs and state it needs.
*/
@Test
component Int8LinearAccumulatorTest
{
// Shared fixture instances, signals, and observation state.
dut: Int8LinearAccumulator
/**
* Creates the shared fixture instances (Int8LinearAccumulator). Tests initialize the state
* required by their scenario.
*/
new()
{
this.dut = new Int8LinearAccumulator()
}
/**
* Checks the centers values and preserves int32 range case.
*/
@Test
fn CentersValuesAndPreservesInt32Range()
{
this.dut.Begin(100, 2, -3)
this.dut.Accumulate(4, 5)
this.dut.Accumulate(0, -5)
assert this.dut.GetAccumulator() == 120
this.dut.Begin(0, 0, 0)
this.dut.Accumulate(1000, 1000)
assert this.dut.GetAccumulator() == 1000000
}
}