microsoft / onnxjs

ONNX.js: run ONNX models using JavaScript
Other
1.75k stars 130 forks source link

add support for pack kernel to pack different texture layouts #281

Closed xzhu1900 closed 3 years ago

xzhu1900 commented 3 years ago

Currently onnx.js has two co-existence texture layouts -- the one used in existing kernels with unpack implementation and the one used in newly added kernels with pack implementation.

This change enables pack kernel to pack both texture layouts correctly, with an unified output texture layout. The change covers input texture in 1D, 2D, 3D and 4D.

The corresponding tests are updated to test both cases.