Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the slice operator and fix the cancat operator #214

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ fn test_matmul_square_matrix() {
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Sin">Sin</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Sin-7">7</a>|✅|✅|
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Sinh">Sinh</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Sinh-9">9</a>|✅|✅|
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Size">Size</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Size-13">13</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Size-1">1</a>|✅|✅|
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Slice">Slice</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Slice-13">13</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Slice-11">11</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Slice-10">10</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Slice-1">1</a>||✅|
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Slice">Slice</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Slice-13">13</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Slice-11">11</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Slice-10">10</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Slice-1">1</a>||✅|
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Softplus">Softplus</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Softplus-1">1</a>|✅|
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#Softsign">Softsign</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#Softsign-1">1</a>|✅|
|<a href="https://github.com/onnx/onnx/blob/main/docs/Operators.md#SpaceToDepth">SpaceToDepth</a>|<a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#SpaceToDepth-13">13</a>, <a href="https://github.com/onnx/onnx/blob/main/docs/Changelog.md#SpaceToDepth-1">1</a>|
Expand Down Expand Up @@ -398,6 +398,8 @@ fn test_matmul_square_matrix() {
* For `MatMul` and `Gemm`, the matrix dimensions must be divisible by 2, or the output matrix must be of size (1, N). Matrix
multiplication only supports floats, not integers (this is a WebGPU/WGSL limitation).

* The Slice operator can only be computed for axes of length one. (i.e., there must always be exactly one axis.)

### Shape inference

WONNX needs to know the shape of input and output tensors for each operation in order to generate shader code for executing
Expand Down
Binary file added data/images/dog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions data/models/coco-classes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
person
bicycle
car
motorbike
aeroplane
bus
train
truck
boat
traffic light
fire hydrant
stop sign
parking meter
bench
bird
cat
dog
horse
sheep
cow
elephant
bear
zebra
giraffe
backpack
umbrella
handbag
tie
suitcase
frisbee
skis
snowboard
sports ball
kite
baseball bat
baseball glove
skateboard
surfboard
tennis racket
bottle
wine glass
cup
fork
knife
spoon
bowl
banana
apple
sandwich
orange
broccoli
carrot
hot dog
pizza
donut
cake
chair
sofa
pottedplant
bed
diningtable
toilet
tvmonitor
laptop
mouse
remote
keyboard
cell phone
microwave
oven
toaster
sink
refrigerator
book
clock
vase
scissors
teddy bear
hair drier
toothbrush
Binary file added data/models/yolox_nano.onnx
Binary file not shown.
3 changes: 2 additions & 1 deletion wonnx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ futures = "^0.3.26"
parking_lot = { version = "0.11.1", features = ["wasm-bindgen"] }

[dev-dependencies]
image = "0.24.2"
image = "0.25.1"
imageproc = "0.24.0"
ndarray = "0.15.4"
approx = "0.5.1"
pollster = "0.3.0"
Expand Down
Loading