提交 d140f1a4 authored 作者: Pascal Lamblin's avatar Pascal Lamblin 提交者: GitHub

Merge pull request #6437 from abergeron/fix_buildbot

Fix problems found on buildbots
...@@ -27,10 +27,10 @@ jobs: ...@@ -27,10 +27,10 @@ jobs:
command: | command: |
if [[ -n "${CIRCLE_TAG}" ]] if [[ -n "${CIRCLE_TAG}" ]]
then then
anaconda -t $BINSTAR_TOKEN upload --user=mila-udem /miniconda/conda-bld/noarch/theano* anaconda -t $BINSTAR_TOKEN upload --user=mila-udem /miniconda/conda-bld/linux-64/theano*
fi fi
- store_artifacts: - store_artifacts:
path: /miniconda/conda-bld/linux-x64 path: /miniconda/conda-bld/linux-64
workflows: workflows:
version: 2 version: 2
......
...@@ -38,6 +38,8 @@ class TestD3Viz(unittest.TestCase): ...@@ -38,6 +38,8 @@ class TestD3Viz(unittest.TestCase):
self.check(f) self.check(f)
def test_mlp_profiled(self): def test_mlp_profiled(self):
if th.config.mode in ("DebugMode", "DEBUG_MODE"):
raise SkipTest("Can't profile in DebugMode")
m = models.Mlp() m = models.Mlp()
profile = th.compile.profiling.ProfileStats(False) profile = th.compile.profiling.ProfileStats(False)
f = th.function(m.inputs, m.outputs, profile=profile) f = th.function(m.inputs, m.outputs, profile=profile)
......
...@@ -1111,6 +1111,10 @@ if (GpuArray_vector_add_fast(%(out)s, %(y)s, %(ind)s, %(params)s->set_instead_of ...@@ -1111,6 +1111,10 @@ if (GpuArray_vector_add_fast(%(out)s, %(y)s, %(ind)s, %(params)s->set_instead_of
""" % dict(x=inputs[0], y=inputs[1], ind=inputs[2], out=outputs[0], fail=sub['fail'], params=sub['params']) """ % dict(x=inputs[0], y=inputs[1], ind=inputs[2], out=outputs[0], fail=sub['fail'], params=sub['params'])
def gpu_kernels(self, node, nodename): def gpu_kernels(self, node, nodename):
# We can't rely on numpy for this, it changes with the OS
CHARMAP = dict(int32='i', uint32='I',
int64='l', uint64='L',
float16='e', float32='f', float64='d')
dtype_x = node.inputs[0].dtype dtype_x = node.inputs[0].dtype
dtype_y = node.inputs[1].dtype dtype_y = node.inputs[1].dtype
dtype_ind = node.inputs[2].dtype dtype_ind = node.inputs[2].dtype
...@@ -1168,7 +1172,7 @@ if (GpuArray_vector_add_fast(%(out)s, %(y)s, %(ind)s, %(params)s->set_instead_of ...@@ -1168,7 +1172,7 @@ if (GpuArray_vector_add_fast(%(out)s, %(y)s, %(ind)s, %(params)s->set_instead_of
return; return;
} }
""" % dict(type_x=type_x, type_y=type_y, type_ind=type_ind, """ % dict(type_x=type_x, type_y=type_y, type_ind=type_ind,
tc=np.dtype(dtype_x).char) tc=CHARMAP[dtype_x])
from pygpu.gpuarray import SIZE, SSIZE from pygpu.gpuarray import SIZE, SSIZE
params = [ params = [
SIZE, SIZE, SSIZE, SSIZE, gpuarray.GpuArray, SIZE, SIZE, SIZE, SSIZE, SSIZE, gpuarray.GpuArray, SIZE,
......
...@@ -1532,6 +1532,8 @@ class Dot22(GemmRelated): ...@@ -1532,6 +1532,8 @@ class Dot22(GemmRelated):
check_input = False check_input = False
def make_node(self, x, y): def make_node(self, x, y):
x = T.as_tensor_variable(x)
y = T.as_tensor_variable(y)
dtypes = ('float16', 'float32', 'float64', 'complex64', 'complex128') dtypes = ('float16', 'float32', 'float64', 'complex64', 'complex128')
if x.type.ndim != 2 or x.type.dtype not in dtypes: if x.type.ndim != 2 or x.type.dtype not in dtypes:
raise TypeError(x) raise TypeError(x)
......
...@@ -1218,7 +1218,7 @@ class UnravelIndex(gof.Op): ...@@ -1218,7 +1218,7 @@ class UnravelIndex(gof.Op):
res = np.unravel_index(indices, dims) res = np.unravel_index(indices, dims)
assert len(res) == len(out) assert len(res) == len(out)
for i in xrange(len(out)): for i in xrange(len(out)):
out[i][0] = res[i] out[i][0] = theano._asarray(res[i], node.outputs[0].dtype)
def unravel_index(indices, dims, order='C', ndim=None): def unravel_index(indices, dims, order='C', ndim=None):
...@@ -1304,8 +1304,9 @@ class RavelMultiIndex(gof.Op): ...@@ -1304,8 +1304,9 @@ class RavelMultiIndex(gof.Op):
def perform(self, node, inp, out): def perform(self, node, inp, out):
multi_index, dims = inp[:-1], inp[-1] multi_index, dims = inp[:-1], inp[-1]
out[0][0] = np.ravel_multi_index(multi_index, dims, res = np.ravel_multi_index(multi_index, dims,
mode=self.mode, order=self.order) mode=self.mode, order=self.order)
out[0][0] = theano._asarray(res, node.outputs[0].dtype)
def ravel_multi_index(multi_index, dims, mode='raise', order='C'): def ravel_multi_index(multi_index, dims, mode='raise', order='C'):
......
...@@ -84,6 +84,9 @@ def test_pydotprint_profile(): ...@@ -84,6 +84,9 @@ def test_pydotprint_profile():
if not theano.printing.pydot_imported: if not theano.printing.pydot_imported:
raise SkipTest('pydot not available') raise SkipTest('pydot not available')
if theano.config.mode in ("DebugMode", "DEBUG_MODE"):
raise SkipTest("Can't profile in DebugMode")
A = tensor.matrix() A = tensor.matrix()
prof = theano.compile.ProfileStats(atexit_print=False, gpu_checks=False) prof = theano.compile.ProfileStats(atexit_print=False, gpu_checks=False)
f = theano.function([A], A + 1, profile=prof) f = theano.function([A], A + 1, profile=prof)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论