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

Merge pull request #5086 from nouiz/mixed

A few small update.
...@@ -27,6 +27,7 @@ Types and Ops that you can use to build and compile expression graphs. ...@@ -27,6 +27,7 @@ Types and Ops that you can use to build and compile expression graphs.
sparse/sandbox sparse/sandbox
tensor/index tensor/index
typed_list typed_list
tests
There are also some top-level imports that you might find more convenient: There are also some top-level imports that you might find more convenient:
......
.. _libdoc_tests:
=====================
:mod:`tests` -- Tests
=====================
.. automodule:: theano.tests.breakpoint
:members:
...@@ -573,4 +573,8 @@ the Ops from Theano and Pylearn2. ...@@ -573,4 +573,8 @@ the Ops from Theano and Pylearn2.
Then send us filename. Then send us filename.
.. autoclass:: theano.tests.breakpoint.PdbBreakpoint Breakpoint during Theano function execution
-------------------------------------------
You can set breakpoing during the execution of a Theano function with
:class:`PdbBreakpoint <theano.tests.breakpoint.PdbBreakpoint>`.
...@@ -369,6 +369,9 @@ Consider again the logistic regression: ...@@ -369,6 +369,9 @@ Consider again the logistic regression:
print("prediction on D") print("prediction on D")
print(predict(D[0])) print(predict(D[0]))
print("floatX=", theano.config.floatX)
print("device=", theano.config.device)
.. testoutput:: .. testoutput::
:hide: :hide:
:options: + ELLIPSIS :options: + ELLIPSIS
......
...@@ -450,7 +450,7 @@ def shape_i(var, i, fgraph=None): ...@@ -450,7 +450,7 @@ def shape_i(var, i, fgraph=None):
if inp.owner: if inp.owner:
recur(inp.owner) recur(inp.owner)
# If the output var isn't marked as being in the graph, # If the output var isn't marked as being in the graph,
# we need to att it in the ShapeFeature. # we need to add it in the ShapeFeature.
shape_feature.on_import(fgraph, node, shape_feature.on_import(fgraph, node,
'gof.ops.shape_i') 'gof.ops.shape_i')
if var not in shape_of: if var not in shape_of:
......
...@@ -2199,7 +2199,7 @@ else: ...@@ -2199,7 +2199,7 @@ else:
"fast_run")) "fast_run"))
optdb.register('gpu_elemwise_fusion', optdb.register('gpu_elemwise_fusion',
tensor.opt.FusionOptimizer(gpu_local_elemwise_fusion), tensor.opt.FusionOptimizer(gpu_local_elemwise_fusion),
71.00, 'fusion', 'local_elemwise_fusion') 49, 'fusion', 'local_elemwise_fusion')
# GpuElemwise inplace # GpuElemwise inplace
gpu_inplace_elemwise_optimizer = tensor.opt.InplaceElemwiseOptimizer( gpu_inplace_elemwise_optimizer = tensor.opt.InplaceElemwiseOptimizer(
......
...@@ -573,11 +573,15 @@ class Subtensor(Op): ...@@ -573,11 +573,15 @@ class Subtensor(Op):
gz, = grads gz, = grads
x = inputs[0] x = inputs[0]
rest = inputs[1:] rest = inputs[1:]
output = self(*inputs) if x.dtype.find('int') != -1:
if output.dtype.find('int') != -1:
first = x.zeros_like().astype(theano.config.floatX) first = x.zeros_like().astype(theano.config.floatX)
else: else:
first = IncSubtensor(self.idx_list)(x.zeros_like(), gz, *rest) # For best optimization, we let this as an inc.
# This allow the opt local_IncSubtensor_serialize to apply first.
# We need to implement an optimization that will convert this to a
# set subtensor.
first = IncSubtensor(self.idx_list)(x.zeros_like(),
gz, *rest)
return ([first] + [DisconnectedType()()] * len(rest)) return ([first] + [DisconnectedType()()] * len(rest))
def connection_pattern(self, node): def connection_pattern(self, node):
......
...@@ -85,12 +85,6 @@ whitelist_flake8 = [ ...@@ -85,12 +85,6 @@ whitelist_flake8 = [
"sandbox/cuda/__init__.py", "sandbox/cuda/__init__.py",
"sandbox/cuda/tests/__init__.py", "sandbox/cuda/tests/__init__.py",
"sandbox/gpuarray/__init__.py", "sandbox/gpuarray/__init__.py",
"sandbox/scan_module/scan_utils.py",
"sandbox/scan_module/scan.py",
"sandbox/scan_module/scan_op.py",
"sandbox/scan_module/__init__.py",
"sandbox/scan_module/tests/test_utils.py",
"sandbox/scan_module/tests/test_scan.py",
"sandbox/linalg/ops.py", "sandbox/linalg/ops.py",
"sandbox/linalg/__init__.py", "sandbox/linalg/__init__.py",
"sandbox/linalg/tests/__init__.py", "sandbox/linalg/tests/__init__.py",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论