Skip to content

Instantly share code, notes, and snippets.

View benlansdell's full-sized avatar

Ben Lansdell benlansdell

View GitHub Profile
@benlansdell
benlansdell / parallel_write.py
Created January 26, 2023 23:20 — forked from rossant/parallel_write.py
Write a NumPy array in parallel from multiple CPUs/processes, using shared memory. No copy/serialization involved. Pure Python/NumPy.
"""Write a NumPy array in parallel from multiple CPUs/processes, using shared memory."""
from contextlib import closing
import multiprocessing as mp
import os
import numpy as np
def _init(shared_arr_):
@benlansdell
benlansdell / extract_scalars.py
Created June 7, 2018 19:17 — forked from wchargin/extract_scalars.py
Extract scalars to CSV using the TensorBoard event multiplexer API
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import errno
import os
import re
__author__ = "Yasunobu OKAMURA"
__copyright__ = "Copyright (c) 2012 Y.Okamura"
__license__ = "GPL v3+"
import xml.parsers.expat
import networkx as nx
class XGMMLParserHelper(object):
"""
"""