#!/usr/bin/env python3 import numpy as np import re re.DOTALL = True np.set_printoptions(precision=5, suppress=True, threshold=np.nan) def random_array_string(): return re.sub(r'^\[(.*)\]$(?s)', r'{\n\1 };', np.array2string(np.random.normal(0,1,122), separator=', ')) print("/* Weights generated by weights.py */") print("static const float wc[122] =", random_array_string()) print() print("static const float wr[122] =", random_array_string())