Skip to content

Commit 0207da9

Browse files
committed
Fix warnings
Related-To: #126
1 parent afd0479 commit 0207da9

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

  • skainet-lang

skainet-lang/skainet-lang-api/src/commonMain/kotlin/sk/ai/net/lang/types/Int32.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public object Int32 : DType {
1111
is Int8 -> true // Int8 can promote to Int32
1212
is Int32 -> true // Same type compatibility
1313
is FP32 -> true // Can promote to FP32
14-
else -> false
14+
is FP16 -> true // Can promote to FP16
1515
}
1616
}
1717

@@ -23,9 +23,6 @@ public object Int32 : DType {
2323
is Int32 -> Int32 // Int32 + Int32 → Int32
2424
is FP32 -> FP32 // Int32 + FP32 → FP32
2525
is FP16 -> FP16 // Int32 + FP16 → FP16
26-
else -> throw IllegalArgumentException(
27-
"Cannot promote Int32 with incompatible type: ${other.name}"
28-
)
2926
}
3027
}
3128
}

skainet-lang/skainet-lang-memory/src/commonMain/kotlin/sk/ai/net/core/tensor/data/DenseTensorDataFactory.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,22 @@ public class DenseTensorDataFactory {
6060
): TensorData<T, V> {
6161
return when (dtype) {
6262
is FP32 -> {
63-
class FP32FloatTensorData(private val data: FloatArray) : TensorData<FP32, Float> {
63+
class FP32FloatTensorData() : TensorData<FP32, Float> {
6464
override val shape: Shape
6565
get() = Shape.Companion(data.size)
6666

6767
override fun get(vararg indices: Int): Float = data[indices[0]]
6868
}
69-
FP32FloatTensorData(data) as TensorData<T, V>
69+
FP32FloatTensorData() as TensorData<T, V>
7070
}
7171
is FP16 -> {
72-
class FP16FloatTensorData(private val data: FloatArray) : TensorData<FP16, Float> {
72+
class FP16FloatTensorData() : TensorData<FP16, Float> {
7373
override val shape: Shape
7474
get() = Shape.Companion(data.size)
7575

7676
override fun get(vararg indices: Int): Float = data[indices[0]]
7777
}
78-
FP16FloatTensorData(data) as TensorData<T, V>
78+
FP16FloatTensorData() as TensorData<T, V>
7979
}
8080
else -> throw IllegalArgumentException("Unsupported dtype for FloatArray: ${dtype.name}")
8181
}
@@ -88,13 +88,13 @@ public class DenseTensorDataFactory {
8888
): TensorData<T, V> {
8989
return when (dtype) {
9090
is Int32 -> {
91-
class Int32IntTensorData(private val data: IntArray) : TensorData<Int32, Int> {
91+
class Int32IntTensorData() : TensorData<Int32, Int> {
9292
override val shape: Shape
9393
get() = Shape.Companion(data.size)
9494

9595
override fun get(vararg indices: Int): Int = data[indices[0]]
9696
}
97-
Int32IntTensorData(data) as TensorData<T, V>
97+
Int32IntTensorData() as TensorData<T, V>
9898
}
9999
else -> throw IllegalArgumentException("Unsupported dtype for IntArray: ${dtype.name}")
100100
}

0 commit comments

Comments
 (0)