提交 7ab32ffb authored 作者: Frederic's avatar Frederic

pep8

上级 abfbff2c
......@@ -236,7 +236,7 @@ class GpuOp(theano.gof.Op):
compute_map, no_recycling)
theano.compile.debugmode.default_make_thunk.append(
get_unbound_function(GpuOp.make_thunk))
get_unbound_function(GpuOp.make_thunk))
# We must do those import to be able to create the full doc when
# nvcc is not available
......
......@@ -373,11 +373,11 @@ class _tensor_py_operators:
and all(a == slice(None) for a in args[:axis])
and all(a == slice(None) for a in args[axis + 1:])
and isinstance(args[axis], (
numpy.ndarray,
list,
TensorVariable,
TensorConstant,
theano.tensor.sharedvar.TensorSharedVariable))):
numpy.ndarray,
list,
TensorVariable,
TensorConstant,
theano.tensor.sharedvar.TensorSharedVariable))):
return self.take(arg, axis)
else:
return theano.tensor.subtensor.advanced_subtensor(self, *args)
......@@ -405,8 +405,9 @@ class _tensor_py_operators:
return rval
else:
return theano.tensor.subtensor.Subtensor(args)(
self, *theano.tensor.subtensor.Subtensor.collapse(args,
lambda entry: isinstance(entry, Variable)))
self, *theano.tensor.subtensor.Subtensor.collapse(
args,
lambda entry: isinstance(entry, Variable)))
def take(self, indices, axis=None, mode='raise'):
return theano.tensor.subtensor.take(self, indices, axis, mode)
......@@ -701,6 +702,7 @@ class TensorConstant(_tensor_py_operators, Constant):
other = theano.tensor.basic.constant(other)
return (isinstance(other, TensorConstant) and
self.signature() == other.signature())
def __copy__(self):
# We need to do this to remove the cached attribute
return type(self)(self.type, self.data, self.name)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论