Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script installs Python and various site packages on sharcnet using gcc. | |
# It will create something similar to virtualenv, but with Python itself built | |
# from scratch. Also, this is not as sophisticated as virtualenv, in particular | |
# it has no `deactivate` function. | |
# | |
# --turn on tracing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
import sys | |
import time | |
import numpy as np | |
N = int(sys.argv[1]) | |
dtype = sys.argv[2] | |
A = np.random.rand(N, N).astype(dtype) | |
B = np.random.rand(N, N).astype(dtype) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.parallel import Client | |
from IPython.parallel import interactive | |
import time | |
import random | |
@interactive | |
def work(i): | |
import time | |
import random | |
sleeptime = 1 + random.random() * 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------------------------------------ | |
# Make things VirtualEnv aware (Linux version). | |
# More info: http://www.swegler.com/becky/blog/2011/08/28/python-django-mysql-on-windows-7-part-3-ipython-virtual-environments/ | |
# add this to the end of ipython_config | |
# (or course, for virtualenvs created via --no-site-packages, it would | |
# be much easier just to install iPython) | |
# | |
# Also consider sourcing this file from ipython_config with execfile(). | |
# | |
#------------------------------------------------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import theano | |
import numpy as np | |
class TorchThunk(object): | |
def __init__(self, op, node, storage, compute, no_recycling): | |
self.op = op | |
self.node = node | |
self.storage = storage | |
self.compute = compute | |
self.no_recycling = no_recycling |