Skip to content

Commit 2c675e3

Browse files
committed
README fixes
1 parent 4f60f19 commit 2c675e3

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ or from your project:
2929
sbt console
3030
```
3131

32+
Note that all code snippets are written in Scala 3 (Dotty).
33+
3234
Run SqueezeNet image classification inference on an "image" composed entirely of pixel value [42](https://upload.wikimedia.org/wikipedia/commons/0/0e/Answer_to_Life_42.svg):
3335

3436
```scala
@@ -40,14 +42,14 @@ import org.emergentorder.compiletime._
4042
import io.kjaer.compiletime._
4143

4244
val squeezenetBytes = Files.readAllBytes(Paths.get("squeezenet1.1.onnx"))
43-
4445
val squeezenet = new ORTModelBackend(squeezenetBytes)
4546

4647
val data = Array.fill(1*3*224*224){42f}
48+
val shape = 1 #: 3 #: 224 #: 224 #: SNil
49+
4750
val tensorDenotation: String & Singleton = "Image"
4851
//In NCHW tensor image format
4952
val tensorShapeDenotation = "Batch" ##: "Channel" ##: "Height" ##: "Width" ##: TSNil
50-
val shape = 1 #: 3 #: 224 #: 224 #: SNil
5153

5254
val imageTens = Tensor(data,tensorDenotation,tensorShapeDenotation,shape)
5355

@@ -63,11 +65,9 @@ val out = squeezenet.fullModel[Float,
6365
"Batch" ##: "Class" ##: TSNil,
6466
1 #: 1000 #: SNil](Tuple(imageTens))
6567
// val out:
66-
// org.emergentorder.onnx.Tensors.Tensor[Float,
67-
// ("ImageNetClassification",
68-
// "Batch" ##: "Class" ##:
69-
// org.emergentorder.compiletime.TSNil
70-
// , 1 #: 1000 #: io.kjaer.compiletime.SNil)] = (Array(0.8230729,
68+
// Tensor[Float,("ImageNetClassification",
69+
// "Batch" ##: "Class" ##: TSNil,
70+
// 1 #: 1000 #: SNil)] = (Array(0.8230729,
7171
// ...
7272

7373
//The output shape

docs/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ or from your project:
2929
sbt console
3030
```
3131

32+
Note that all code snippets are written in Scala 3 (Dotty).
33+
3234
Run SqueezeNet image classification inference on an "image" composed entirely of pixel value [42](https://upload.wikimedia.org/wikipedia/commons/0/0e/Answer_to_Life_42.svg):
3335

3436
```scala
@@ -40,14 +42,14 @@ import org.emergentorder.compiletime._
4042
import io.kjaer.compiletime._
4143

4244
val squeezenetBytes = Files.readAllBytes(Paths.get("squeezenet1.1.onnx"))
43-
4445
val squeezenet = new ORTModelBackend(squeezenetBytes)
4546

4647
val data = Array.fill(1*3*224*224){42f}
48+
val shape = 1 #: 3 #: 224 #: 224 #: SNil
49+
4750
val tensorDenotation: String & Singleton = "Image"
4851
//In NCHW tensor image format
4952
val tensorShapeDenotation = "Batch" ##: "Channel" ##: "Height" ##: "Width" ##: TSNil
50-
val shape = 1 #: 3 #: 224 #: 224 #: SNil
5153

5254
val imageTens = Tensor(data,tensorDenotation,tensorShapeDenotation,shape)
5355

@@ -63,11 +65,9 @@ val out = squeezenet.fullModel[Float,
6365
"Batch" ##: "Class" ##: TSNil,
6466
1 #: 1000 #: SNil](Tuple(imageTens))
6567
// val out:
66-
// org.emergentorder.onnx.Tensors.Tensor[Float,
67-
// ("ImageNetClassification",
68-
// "Batch" ##: "Class" ##:
69-
// org.emergentorder.compiletime.TSNil
70-
// , 1 #: 1000 #: io.kjaer.compiletime.SNil)] = (Array(0.8230729,
68+
// Tensor[Float,("ImageNetClassification",
69+
// "Batch" ##: "Class" ##: TSNil,
70+
// 1 #: 1000 #: SNil)] = (Array(0.8230729,
7171
// ...
7272

7373
//The output shape

0 commit comments

Comments
 (0)