Skip to content

Instantly share code, notes, and snippets.

import tensorflow as tf
gpu_fraction = 0.1
vector_size = 100
n = 1
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=gpu_fraction)
config = tf.ConfigProto(gpu_options=gpu_options)
for i in range(n):
with tf.Session(config=config) as sess:
a = tf.random.normal([vector_size])
import pyperclip as clipboard
# path of file to open
openFile = "stats.txt"
# row will be populated in this order
L2Size = 2
L3Size = 4
TestSet = "gcc"
keysToLookFor = ['sim_seconds',
# path of file to open
openFile = "stats.txt"
saveFile = openFile + ".json"
# returns string representations of items in array as a single string joined with joiner
# inserted between each item
def strJoin (sarr, joiner):
@dare0021
dare0021 / wavOpener.py
Last active July 12, 2016 07:12
A more complex wave file opener. Just a bit more complex.
import numpy as np
import wave
import struct
waveFile = "No open file"
path = ""
# 0 is the least verbose
printLevel = 0
def open(input, verbose=0):
@dare0021
dare0021 / wav.py
Last active July 12, 2016 06:13
Python code to open uncompressed wave files
import wave
import struct
import sys
# the only non-default library
import numpy as np
input = "file_path_here.wav"
waveFile = wave.open(input, 'r')