Recently, I have played around a bit with onnx-models. One thing I wanted to do was to piece together multiple small models into one large model. I didn´t find any utility to do this (though it might be the issue that I didn´t look hard enough), so I decided to figure out how hard it was to do by hand. This little post details that little adventure. _Please be warned that I am definitely no expert on onnx-models, so don´t take anything I write here as
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import chain | |
def radixSortLsb(a): | |
for b in range(0,10): | |
a = list(chain(filter(lambda x: ((x>>b)&1) == 0, a), | |
filter(lambda x: ((x>>b)&1) != 0, a))) | |
return a | |
ai =[503, 87, 512, 61, 908, 170, 897, 275, 653, 426, 154, 509, 612, 677, 765, 703] | |
radixSortLsb(ai) |
Recently, I've worked with Emscripten, producing web-assembly from C++. As a result, I've become curious of how much the wasm-binary grows by including this or that code. Even though caring about code size seems to be out of fashion since we stopped using floppy disks to move programs around, it does matter somewhat on the web, as every client has to download the binary, maybe over a cellular connection etc.