Skip to content

Instantly share code, notes, and snippets.

@psinger
Created March 18, 2018 13:53
Show Gist options
  • Save psinger/a703981db7400c5591ebd07b69109060 to your computer and use it in GitHub Desktop.
Save psinger/a703981db7400c5591ebd07b69109060 to your computer and use it in GitHub Desktop.
f = tb.open_file('dot.h5', 'w')
filters = tb.Filters(complevel=5, complib='blosc')
out_data = f.create_earray(f.root, 'data', tb.Float32Atom(), shape=(0,), filters=filters)
out_ri = f.create_earray(f.root, 'ri', tb.Float32Atom(),shape=(0,), filters=filters)
out_ci = f.create_earray(f.root, 'ci', tb.Float32Atom(), shape=(0,), filters=filters)
for i in range(0, l, bl):
res = a.dot(b[:,i:min(i+bl, l)])
vals = res.data
ri, ci = res.nonzero()
out_data.append(vals)
out_ri.append(ri)
out_ci.append(ci)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment