提交 6d8bd41f authored 作者: Chiheb Trabelsi's avatar Chiheb Trabelsi

var.py has been modified in order to respect the flake8 style.

上级 fa143f13
...@@ -13,7 +13,7 @@ try: ...@@ -13,7 +13,7 @@ try:
# We must do those import to be able to create the full doc when nvcc # We must do those import to be able to create the full doc when nvcc
# is not available # is not available
from theano.sandbox.cuda import filter as type_support_filter from theano.sandbox.cuda import filter as type_support_filter
from theano.sandbox.cuda.basic_ops import HostFromGpu, GpuFromHost from theano.sandbox.cuda.basic_ops import HostFromGpu
except ImportError: except ImportError:
pass pass
...@@ -33,6 +33,7 @@ class _operators(tensor.basic._tensor_py_operators): ...@@ -33,6 +33,7 @@ class _operators(tensor.basic._tensor_py_operators):
def _as_TensorVariable(self): def _as_TensorVariable(self):
return HostFromGpu()(self) return HostFromGpu()(self)
def _as_CudaNdarrayVariable(self): def _as_CudaNdarrayVariable(self):
return self return self
...@@ -54,6 +55,7 @@ class CudaNdarrayConstantSignature(tensor.TensorConstantSignature): ...@@ -54,6 +55,7 @@ class CudaNdarrayConstantSignature(tensor.TensorConstantSignature):
class CudaNdarrayConstant(_operators, Constant): class CudaNdarrayConstant(_operators, Constant):
def signature(self): def signature(self):
return CudaNdarrayConstantSignature((self.type, numpy.asarray(self.data))) return CudaNdarrayConstantSignature((self.type, numpy.asarray(self.data)))
def __str__(self): def __str__(self):
if self.name is not None: if self.name is not None:
return self.name return self.name
...@@ -61,7 +63,7 @@ class CudaNdarrayConstant(_operators, Constant): ...@@ -61,7 +63,7 @@ class CudaNdarrayConstant(_operators, Constant):
data = str(numpy.asarray(self.data)) data = str(numpy.asarray(self.data))
except Exception as e: except Exception as e:
data = "error while transferring the value: " + str(e) data = "error while transferring the value: " + str(e)
return "CudaNdarrayConstant{"+data+"}" return "CudaNdarrayConstant{" + data + "}"
CudaNdarrayType.Constant = CudaNdarrayConstant CudaNdarrayType.Constant = CudaNdarrayConstant
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论