@@ -44,7 +44,7 @@ val squeezenetBytes = Files.readAllBytes(Paths.get("squeezenet1.1.onnx"))
44
44
val squeezenet = new ORTModelBackend (squeezenetBytes)
45
45
46
46
val data = Array .fill(1 * 3 * 224 * 224 ){42f }
47
- val tensorDenotation : String & Singleton = " SomeTensorType "
47
+ val tensorDenotation : String & Singleton = " Image "
48
48
// In NCHW tensor image format
49
49
val tensorShapeDenotation = " Batch" ##: " Channel" ##: " Height" ##: " Width" ##: TSNil
50
50
val shape = 1 #: 3 #: 224 #: 224 #: SNil
@@ -58,12 +58,13 @@ val imageTensDefaultDenotations = Tensor(data,shape)
58
58
Note that ONNX Tensor content is in row-major order.
59
59
60
60
``` scala
61
- val out = squeezenet.fullModel[Float , " T " ," T " ##: TSNil ,1 #: 1000 #: SNil ](Tuple (imageTens))
61
+ val out = squeezenet.fullModel[Float , " ImageNetClassification " ," Batch " ##: " Class " ##: TSNil ,1 #: 1000 #: SNil ](Tuple (imageTens))
62
62
// val out:
63
- // org.emergentorder.onnx.Tensors.Tensor[Float, ("T ", "T " ##:
63
+ // org.emergentorder.onnx.Tensors.Tensor[Float, ("ImageNetClassification ", "Batch" ##: "Class " ##:
64
64
// org.emergentorder.compiletime.TSNil
65
65
// , 1 #: 1000 #: io.kjaer.compiletime.SNil)] = (Array(0.8230729,
66
66
// ...
67
+
67
68
// The output shape
68
69
out.shape
69
70
// val res0: Array[Int] = Array(1, 1000)
@@ -95,7 +96,7 @@ val onnxBackend = new ORTOperatorBackendAll()
95
96
96
97
val longTens = Tensor (Array .fill(1 * 3 * 224 * 224 ){- 42l },tensorDenotation,tensorShapeDenotation,shape)
97
98
// longTens:
98
- // org.emergentorder.onnx.Tensors.Tensor[Float, ("T ", "T " ##:
99
+ // org.emergentorder.onnx.Tensors.Tensor[Float, ("Image ", "Batch" ##: "Channel" ##: "Height" ##: "Width " ##:
99
100
// org.emergentorder.compiletime.TSNil
100
101
// , 1 #: 1000 #: io.kjaer.compiletime.SNil)] = (
101
102
// Array(
@@ -105,7 +106,7 @@ val longTens = Tensor(Array.fill(1*3*224*224){-42l},tensorDenotation,tensorShape
105
106
106
107
onnxBackend.AbsV6 (" abs" , longTens)
107
108
// res2:
108
- // org.emergentorder.onnx.Tensors.Tensor[Float, ("T ", "T " ##:
109
+ // org.emergentorder.onnx.Tensors.Tensor[Float, ("Image ", "Batch" ##: "Channel" ##: "Height" ##: "Width " ##:
109
110
// org.emergentorder.compiletime.TSNil
110
111
// , 1 #: 1000 #: io.kjaer.compiletime.SNil)] = (
111
112
// Array(
0 commit comments