@@ -40,7 +40,7 @@ class FP32TensorFactoryTest {
4040 val floats = floatArrayOf(1.0f , 2.0f , 3.0f , 4.0f )
4141 val bytes = createFloatBytes(floats)
4242
43- val tensor = FP32TensorFactory .fromGGUFData (shape, bytes)
43+ val tensor = FP32TensorFactory .fromByteArray (shape, bytes)
4444
4545 assertNotNull(tensor, " Tensor should be created" )
4646 assertEquals(shape, tensor.shape, " Shape should match" )
@@ -59,7 +59,7 @@ class FP32TensorFactoryTest {
5959 val floats = floatArrayOf(1.0f , 2.0f , 3.0f , 4.0f , 5.0f , 6.0f )
6060 val bytes = createFloatBytes(floats)
6161
62- val tensor = FP32TensorFactory .fromGGUFData (shape, bytes)
62+ val tensor = FP32TensorFactory .fromByteArray (shape, bytes)
6363
6464 assertNotNull(tensor, " Tensor should be created" )
6565 assertEquals(shape, tensor.shape, " Shape should match" )
@@ -81,7 +81,7 @@ class FP32TensorFactoryTest {
8181 val floats = floatArrayOf(1.0f , 2.0f , 3.0f , 4.0f , 5.0f , 6.0f , 7.0f , 8.0f )
8282 val bytes = createFloatBytes(floats)
8383
84- val tensor = FP32TensorFactory .fromGGUFData (shape, bytes)
84+ val tensor = FP32TensorFactory .fromByteArray (shape, bytes)
8585
8686 assertNotNull(tensor, " Tensor should be created" )
8787 assertEquals(shape, tensor.shape, " Shape should match" )
@@ -100,7 +100,7 @@ class FP32TensorFactoryTest {
100100 val floats = FloatArray (16 ) { (it + 1 ).toFloat() } // [1.0, 2.0, ..., 16.0]
101101 val bytes = createFloatBytes(floats)
102102
103- val tensor = FP32TensorFactory .fromGGUFData (shape, bytes)
103+ val tensor = FP32TensorFactory .fromByteArray (shape, bytes)
104104
105105 assertNotNull(tensor, " Tensor should be created" )
106106 assertEquals(shape, tensor.shape, " Shape should match" )
@@ -118,7 +118,7 @@ class FP32TensorFactoryTest {
118118 val floats = FloatArray (10000 ) { it.toFloat() }
119119 val bytes = createFloatBytes(floats)
120120
121- val tensor = FP32TensorFactory .fromGGUFData (shape, bytes)
121+ val tensor = FP32TensorFactory .fromByteArray (shape, bytes)
122122
123123 assertNotNull(tensor, " Large tensor should be created" )
124124 assertEquals(shape, tensor.shape, " Shape should match" )
@@ -147,7 +147,7 @@ class FP32TensorFactoryTest {
147147 val shape = Shape (8 )
148148 val bytes = createFloatBytes(specialFloats)
149149
150- val tensor = FP32TensorFactory .fromGGUFData (shape, bytes)
150+ val tensor = FP32TensorFactory .fromByteArray (shape, bytes)
151151
152152 assertNotNull(tensor, " Tensor with special values should be created" )
153153 assertEquals(shape, tensor.shape, " Shape should match" )
@@ -170,7 +170,7 @@ class FP32TensorFactoryTest {
170170 val wrongSizeBytes = ByteArray (12 ) // Only 12 bytes (3 floats)
171171
172172 assertFailsWith<IllegalArgumentException >(" Should throw for wrong byte array size" ) {
173- FP32TensorFactory .fromGGUFData (shape, wrongSizeBytes)
173+ FP32TensorFactory .fromByteArray (shape, wrongSizeBytes)
174174 }
175175 }
176176
@@ -182,13 +182,13 @@ class FP32TensorFactoryTest {
182182 // Test with zero dimension
183183 assertFailsWith<IllegalArgumentException >(" Should throw for zero dimension" ) {
184184 val invalidShape = Shape (0 , 4 )
185- FP32TensorFactory .fromGGUFData (invalidShape, bytes)
185+ FP32TensorFactory .fromByteArray (invalidShape, bytes)
186186 }
187187
188188 // Test with negative dimension
189189 assertFailsWith<IllegalArgumentException >(" Should throw for negative dimension" ) {
190190 val invalidShape = Shape (- 1 , 4 )
191- FP32TensorFactory .fromGGUFData (invalidShape, bytes)
191+ FP32TensorFactory .fromByteArray (invalidShape, bytes)
192192 }
193193 }
194194
@@ -199,7 +199,7 @@ class FP32TensorFactoryTest {
199199 val emptyBytes = ByteArray (0 )
200200
201201 assertFailsWith<IllegalArgumentException >(" Should throw for empty byte array" ) {
202- FP32TensorFactory .fromGGUFData (shape, emptyBytes)
202+ FP32TensorFactory .fromByteArray (shape, emptyBytes)
203203 }
204204 }
205205
@@ -210,7 +210,7 @@ class FP32TensorFactoryTest {
210210 val misalignedBytes = ByteArray (7 ) // Not divisible by 4
211211
212212 assertFailsWith<IllegalArgumentException >(" Should throw for misaligned bytes" ) {
213- FP32TensorFactory .fromGGUFData (shape, misalignedBytes)
213+ FP32TensorFactory .fromByteArray (shape, misalignedBytes)
214214 }
215215 }
216216
@@ -221,7 +221,7 @@ class FP32TensorFactoryTest {
221221 val floats = floatArrayOf(42.0f )
222222 val bytes = createFloatBytes(floats)
223223
224- val tensor = FP32TensorFactory .fromGGUFData (shape, bytes)
224+ val tensor = FP32TensorFactory .fromByteArray (shape, bytes)
225225
226226 assertNotNull(tensor, " Minimal tensor should be created" )
227227 assertEquals(shape, tensor.shape, " Shape should match" )
@@ -239,7 +239,7 @@ class FP32TensorFactoryTest {
239239 val floats = FloatArray (size) { it.toFloat() }
240240 val bytes = createFloatBytes(floats)
241241
242- val tensor = FP32TensorFactory .fromGGUFData (shape, bytes)
242+ val tensor = FP32TensorFactory .fromByteArray (shape, bytes)
243243
244244 assertNotNull(tensor, " Tensor of size $size should be created" )
245245 assertEquals(shape, tensor.shape, " Shape should match for size $size " )
@@ -273,7 +273,7 @@ class FP32TensorFactoryTest {
273273 val floats = FloatArray (expectedVolume) { (it + 1 ).toFloat() }
274274 val bytes = createFloatBytes(floats)
275275
276- val tensor = FP32TensorFactory .fromGGUFData (shape, bytes)
276+ val tensor = FP32TensorFactory .fromByteArray (shape, bytes)
277277
278278 assertNotNull(tensor, " Tensor with shape $shape should be created" )
279279 assertEquals(shape, tensor.shape, " Shape should match for $shape " )
@@ -296,7 +296,7 @@ class FP32TensorFactoryTest {
296296 val shape = Shape (6 )
297297 val bytes = createFloatBytes(preciseFloats)
298298
299- val tensor = FP32TensorFactory .fromGGUFData (shape, bytes)
299+ val tensor = FP32TensorFactory .fromByteArray (shape, bytes)
300300
301301 assertNotNull(tensor, " Precision tensor should be created" )
302302 assertEquals(shape, tensor.shape, " Shape should match" )
0 commit comments