Imported from https://github.com/hebo1221/RandWireNN