提交 4800a51c authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #3940 from abergeron/fix_buildbot

Fix most of the remaining DeprecationWarnings in the tests.
......@@ -1671,7 +1671,7 @@ class TrueDiv(BinaryScalarOp):
# This is different from it not being connected
# to the output; x/y is still a function of x
# and y; it's just a step function.
if (x / y).type in discrete_types:
if all(a.dtype in discrete_types for a in (x, y)):
return [x.zeros_like(), y.zeros_like()]
first_part = gz / y
......
......@@ -1360,7 +1360,8 @@ class MaxAndArgmax(Op):
dtype=node.outputs[0].dtype)
# Numpy does not support multiple axes for argmax
# Work around
keep_axes = numpy.array([i for i in range(x.ndim) if i not in axes])
keep_axes = numpy.array([i for i in range(x.ndim) if i not in axes],
dtype='int64')
# Not-reduced axes in front
transposed_x = numpy.transpose(x, numpy.concatenate((keep_axes, axes)))
reshaped_x = transposed_x.reshape(transposed_x.shape[:len(keep_axes)] +
......
......@@ -6791,8 +6791,8 @@ def test_unalign():
else:
dtype = "b1,f4"
a = numpy.empty(1e4, dtype=dtype)['f1']
b = numpy.empty(1e4, dtype=dtype)['f1']
a = numpy.empty(10000, dtype=dtype)['f1']
b = numpy.empty(10000, dtype=dtype)['f1']
assert not a.flags.aligned
assert not b.flags.aligned
a[:] = rand(len(a))
......
......@@ -12,7 +12,6 @@ def test_bug_2009_06_02_trac_387():
f = theano.function([y],
tensor.int_div(
tensor.DimShuffle(y[0].broadcastable, ['x'])(y[0]), 2))
sys.stdout.flush()
print(f(numpy.ones(1, dtype='int64') * 3))
# XXX: there is no assert, nor comment that DEBUGMODE is to do the
# checking. What was the bug, and how is it being tested?
......
......@@ -165,7 +165,7 @@ def test_argsort():
# Example 2
a = tensor.dmatrix()
axis = tensor.scalar()
axis = tensor.lscalar()
w = argsort(a, axis)
f = theano.function([a, axis], w)
for axis_val in 0, 1:
......@@ -183,7 +183,7 @@ def test_argsort():
# Example 4
a = tensor.dmatrix()
axis = tensor.scalar()
axis = tensor.lscalar()
l = argsort(a, axis, "mergesort")
f = theano.function([a, axis], l)
for axis_val in 0, 1:
......@@ -193,7 +193,7 @@ def test_argsort():
# Example 5
a = tensor.dmatrix()
axis = tensor.scalar()
axis = tensor.lscalar()
a1 = ArgSortOp("mergesort", [])
a2 = ArgSortOp("quicksort", [])
# All the below should give true
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论