Skip to content

Instantly share code, notes, and snippets.

@vanechu
Created August 23, 2014 06:03
Show Gist options
  • Save vanechu/3f05391192bfc360b7cf to your computer and use it in GitHub Desktop.
Save vanechu/3f05391192bfc360b7cf to your computer and use it in GitHub Desktop.
test_numpy.py
import numpy
import sys
import timeit
try:
import numpy.core._dotblas
print 'FAST BLAS'
except ImportError:
print 'slow blas'
print "version:", numpy.__version__
print "maxint:", sys.maxint
print
x = numpy.random.random((1000,1000))
setup = "import numpy; x = numpy.random.random((1000,1000))"
count = 5
t = timeit.Timer("numpy.dot(x, x.T)", setup=setup)
print "dot:", t.timeit(count)/count, "sec"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment