Skip to content

Instantly share code, notes, and snippets.

Avatar

Christopher Dyken cdyk

View GitHub Profile
@cdyk
cdyk / ducttape_onnx.md
Created May 31, 2020
Duct-taping onnx-models into a composite onnx-model
View ducttape_onnx.md

Duct-taping onnx-models into a composite onnx-model

Christopher Dyken

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

@cdyk
cdyk / lsb_radix_sort.py
Created Mar 7, 2020
Radix sort starting with least significant bit
View lsb_radix_sort.py
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)
@cdyk
cdyk / bytesinwasm.md
Last active Feb 12, 2021
Who to blame for the bytes in the WASM?
View bytesinwasm.md

Who to blame for the bytes in the WASM?

Christopher Dyken

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.