Skip to content

Commit 006d886

Browse files
committed
More README updates
1 parent 37296f4 commit 006d886

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ val squeezenetBytes = Files.readAllBytes(Paths.get("squeezenet1.1.onnx"))
4444
val squeezenet = new ORTModelBackend(squeezenetBytes)
4545

4646
val data = Array.fill(1*3*224*224){42f}
47-
val tensorDenotation: String & Singleton = "SomeTensorType"
47+
val tensorDenotation: String & Singleton = "Image"
4848
//In NCHW tensor image format
4949
val tensorShapeDenotation = "Batch" ##: "Channel" ##: "Height" ##: "Width" ##: TSNil
5050
val shape = 1 #: 3 #: 224 #: 224 #: SNil
@@ -58,12 +58,13 @@ val imageTensDefaultDenotations = Tensor(data,shape)
5858
Note that ONNX Tensor content is in row-major order.
5959

6060
```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))
6262
// val out:
63-
// org.emergentorder.onnx.Tensors.Tensor[Float, ("T", "T" ##:
63+
// org.emergentorder.onnx.Tensors.Tensor[Float, ("ImageNetClassification", "Batch" ##: "Class" ##:
6464
// org.emergentorder.compiletime.TSNil
6565
// , 1 #: 1000 #: io.kjaer.compiletime.SNil)] = (Array(0.8230729,
6666
// ...
67+
6768
//The output shape
6869
out.shape
6970
// val res0: Array[Int] = Array(1, 1000)
@@ -95,7 +96,7 @@ val onnxBackend = new ORTOperatorBackendAll()
9596

9697
val longTens = Tensor(Array.fill(1*3*224*224){-42l},tensorDenotation,tensorShapeDenotation,shape)
9798
// longTens:
98-
// org.emergentorder.onnx.Tensors.Tensor[Float, ("T", "T" ##:
99+
// org.emergentorder.onnx.Tensors.Tensor[Float, ("Image", "Batch" ##: "Channel" ##: "Height" ##: "Width" ##:
99100
// org.emergentorder.compiletime.TSNil
100101
// , 1 #: 1000 #: io.kjaer.compiletime.SNil)] = (
101102
// Array(
@@ -105,7 +106,7 @@ val longTens = Tensor(Array.fill(1*3*224*224){-42l},tensorDenotation,tensorShape
105106

106107
onnxBackend.AbsV6("abs", longTens)
107108
// res2:
108-
// org.emergentorder.onnx.Tensors.Tensor[Float, ("T", "T" ##:
109+
// org.emergentorder.onnx.Tensors.Tensor[Float, ("Image", "Batch" ##: "Channel" ##: "Height" ##: "Width" ##:
109110
// org.emergentorder.compiletime.TSNil
110111
// , 1 #: 1000 #: io.kjaer.compiletime.SNil)] = (
111112
// Array(

docs/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ val squeezenetBytes = Files.readAllBytes(Paths.get("squeezenet1.1.onnx"))
4444
val squeezenet = new ORTModelBackend(squeezenetBytes)
4545

4646
val data = Array.fill(1*3*224*224){42f}
47-
val tensorDenotation: String & Singleton = "SomeTensorType"
47+
val tensorDenotation: String & Singleton = "Image"
4848
//In NCHW tensor image format
4949
val tensorShapeDenotation = "Batch" ##: "Channel" ##: "Height" ##: "Width" ##: TSNil
5050
val shape = 1 #: 3 #: 224 #: 224 #: SNil
@@ -58,12 +58,13 @@ val imageTensDefaultDenotations = Tensor(data,shape)
5858
Note that ONNX Tensor content is in row-major order.
5959

6060
```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))
6262
// val out:
63-
// org.emergentorder.onnx.Tensors.Tensor[Float, ("T", "T" ##:
63+
// org.emergentorder.onnx.Tensors.Tensor[Float, ("ImageNetClassification", "Batch" ##: "Class" ##:
6464
// org.emergentorder.compiletime.TSNil
6565
// , 1 #: 1000 #: io.kjaer.compiletime.SNil)] = (Array(0.8230729,
6666
// ...
67+
6768
//The output shape
6869
out.shape
6970
// val res0: Array[Int] = Array(1, 1000)
@@ -95,7 +96,7 @@ val onnxBackend = new ORTOperatorBackendAll()
9596

9697
val longTens = Tensor(Array.fill(1*3*224*224){-42l},tensorDenotation,tensorShapeDenotation,shape)
9798
// longTens:
98-
// org.emergentorder.onnx.Tensors.Tensor[Float, ("T", "T" ##:
99+
// org.emergentorder.onnx.Tensors.Tensor[Float, ("Image", "Batch" ##: "Channel" ##: "Height" ##: "Width" ##:
99100
// org.emergentorder.compiletime.TSNil
100101
// , 1 #: 1000 #: io.kjaer.compiletime.SNil)] = (
101102
// Array(
@@ -105,7 +106,7 @@ val longTens = Tensor(Array.fill(1*3*224*224){-42l},tensorDenotation,tensorShape
105106

106107
onnxBackend.AbsV6("abs", longTens)
107108
// res2:
108-
// org.emergentorder.onnx.Tensors.Tensor[Float, ("T", "T" ##:
109+
// org.emergentorder.onnx.Tensors.Tensor[Float, ("Image", "Batch" ##: "Channel" ##: "Height" ##: "Width" ##:
109110
// org.emergentorder.compiletime.TSNil
110111
// , 1 #: 1000 #: io.kjaer.compiletime.SNil)] = (
111112
// Array(

0 commit comments

Comments
 (0)