|
1 | 1 | package org.emergentorder.onnx.backends
|
2 | 2 |
|
3 | 3 | import scala.language.implicitConversions
|
4 |
| -import scala.concurrent._ |
5 |
| -import scala.concurrent.duration._ |
| 4 | +import scala.concurrent.* |
| 5 | +import scala.concurrent.duration.* |
6 | 6 | import scala.concurrent.ExecutionContext.Implicits.global
|
7 |
| -import scala.concurrent.duration._ |
8 |
| -import ai.onnxruntime._ |
9 |
| -import scala.jdk.CollectionConverters._ |
| 7 | +import scala.concurrent.duration.* |
| 8 | +import compiletime.asMatchable |
| 9 | +import ai.onnxruntime.* |
| 10 | +import scala.jdk.CollectionConverters.* |
10 | 11 |
|
11 | 12 | import cats.effect.IO
|
12 |
| -import cats.implicits._ |
| 13 | +import cats.implicits.* |
13 | 14 | import cats.effect.unsafe.implicits.global
|
14 |
| -import org.emergentorder.onnx._ |
15 |
| -import org.emergentorder.onnx.Tensors._ |
16 |
| -import org.emergentorder.onnx.Tensors.Tensor._ |
17 |
| -import org.emergentorder.compiletime._ |
18 |
| -import io.kjaer.compiletime._ |
| 15 | +import org.emergentorder.onnx.* |
| 16 | +import org.emergentorder.onnx.Tensors.* |
| 17 | +import org.emergentorder.onnx.Tensors.Tensor.* |
| 18 | +import org.emergentorder.compiletime.* |
| 19 | +import io.kjaer.compiletime.* |
19 | 20 |
|
20 |
| -import ORTTensorUtils._ |
| 21 | +import ORTTensorUtils.* |
21 | 22 |
|
22 | 23 | //TODO: Clean up, remove asInstaceOf, etc.
|
23 | 24 | class ORTModelBackend(onnxBytes: Array[Byte])
|
@@ -59,8 +60,8 @@ class ORTModelBackend(onnxBytes: Array[Byte])
|
59 | 60 | .map { i =>
|
60 | 61 | val tup = inputs.drop(i).take(1)
|
61 | 62 | tup match { // Spurious warning here, see: https://github.com/lampepfl/dotty/issues/10318
|
62 |
| - case t: Tuple1[_] => |
63 |
| - t(0) match { |
| 63 | + case t: Tuple1[?] => |
| 64 | + t(0).asMatchable match { |
64 | 65 | case tens: Tensor[T, Tuple3[Tt, Td, S]] =>
|
65 | 66 | tens.data.map(x => tens.shape.map(y => getOnnxTensor(x, y, env))).flatten
|
66 | 67 | }
|
|
0 commit comments