提交 9f46fb07 authored 作者: Li Yao's avatar Li Yao

pep8

上级 bfe0057f
...@@ -337,7 +337,7 @@ class mrg_uniform(mrg_uniform_base): ...@@ -337,7 +337,7 @@ class mrg_uniform(mrg_uniform_base):
v_size = as_tensor_variable(size) v_size = as_tensor_variable(size)
if ndim is None: if ndim is None:
ndim = get_vector_length(v_size) ndim = get_vector_length(v_size)
op = cls(TensorType(dtype, (False,)*ndim)) op = cls(TensorType(dtype, (False,) * ndim))
return op(rstate, v_size) return op(rstate, v_size)
def perform(self, node, inp, out): def perform(self, node, inp, out):
...@@ -444,9 +444,9 @@ class mrg_uniform(mrg_uniform_base): ...@@ -444,9 +444,9 @@ class mrg_uniform(mrg_uniform_base):
if (n_elements > M1) if (n_elements > M1)
{ {
PyErr_SetString( PyErr_SetString(
PyExc_ValueError, PyExc_ValueError,
"rng_mrg cpu-implementation does not support more than (2**31 -1) samples"); "rng_mrg cpu-implementation does not support more than (2**31 -1) samples");
%(fail)s %(fail)s
} }
if (must_alloc_sample) if (must_alloc_sample)
...@@ -553,7 +553,7 @@ class GPU_mrg_uniform(mrg_uniform_base, GpuOp): ...@@ -553,7 +553,7 @@ class GPU_mrg_uniform(mrg_uniform_base, GpuOp):
v_size = as_tensor_variable(size) v_size = as_tensor_variable(size)
if ndim is None: if ndim is None:
ndim = get_vector_length(v_size) ndim = get_vector_length(v_size)
op = cls(CudaNdarrayType((False,)*ndim)) op = cls(CudaNdarrayType((False,) * ndim))
return op(rstate, v_size) return op(rstate, v_size)
def c_support_code_apply(self, node, nodename): def c_support_code_apply(self, node, nodename):
...@@ -686,7 +686,7 @@ class GPU_mrg_uniform(mrg_uniform_base, GpuOp): ...@@ -686,7 +686,7 @@ class GPU_mrg_uniform(mrg_uniform_base, GpuOp):
%(ndim)s, PyArray_DIMS(%(size)s)[0]); %(ndim)s, PyArray_DIMS(%(size)s)[0]);
%(fail)s %(fail)s
} }
for (int i = 0; i < %(ndim)s; ++i) for (int i = 0; i < %(ndim)s; ++i)
{ {
odims[i] = *(dtype_%(size)s *)PyArray_GETPTR1(%(size)s, i); odims[i] = *(dtype_%(size)s *)PyArray_GETPTR1(%(size)s, i);
...@@ -698,9 +698,9 @@ class GPU_mrg_uniform(mrg_uniform_base, GpuOp): ...@@ -698,9 +698,9 @@ class GPU_mrg_uniform(mrg_uniform_base, GpuOp):
if (n_elements > M1) if (n_elements > M1)
{ {
PyErr_SetString( PyErr_SetString(
PyExc_ValueError, PyExc_ValueError,
"rng_mrg gpu implementation does not support more than (2**31 -1) samples"); "rng_mrg gpu implementation does not support more than (2**31 -1) samples");
%(fail)s %(fail)s
} }
if (must_alloc_sample) if (must_alloc_sample)
...@@ -800,7 +800,7 @@ class GPUA_mrg_uniform(GpuKernelBase, mrg_uniform_base): ...@@ -800,7 +800,7 @@ class GPUA_mrg_uniform(GpuKernelBase, mrg_uniform_base):
v_size = as_tensor_variable(size) v_size = as_tensor_variable(size)
if ndim is None: if ndim is None:
ndim = get_vector_length(v_size) ndim = get_vector_length(v_size)
op = cls(GpuArrayType(dtype, (False,)*ndim)) op = cls(GpuArrayType(dtype, (False,) * ndim))
return op(rstate, v_size) return op(rstate, v_size)
def c_headers(self): def c_headers(self):
...@@ -950,7 +950,7 @@ class GPUA_mrg_uniform(GpuKernelBase, mrg_uniform_base): ...@@ -950,7 +950,7 @@ class GPUA_mrg_uniform(GpuKernelBase, mrg_uniform_base):
%(ndim)s, PyArray_DIMS(%(size)s)[0]); %(ndim)s, PyArray_DIMS(%(size)s)[0]);
%(fail)s %(fail)s
} }
for (int i = 0; i < %(ndim)s; ++i) for (int i = 0; i < %(ndim)s; ++i)
{ {
odims[i] = *(dtype_%(size)s *)PyArray_GETPTR1(%(size)s, i); odims[i] = *(dtype_%(size)s *)PyArray_GETPTR1(%(size)s, i);
...@@ -962,9 +962,9 @@ class GPUA_mrg_uniform(GpuKernelBase, mrg_uniform_base): ...@@ -962,9 +962,9 @@ class GPUA_mrg_uniform(GpuKernelBase, mrg_uniform_base):
if (n_elements > M1) if (n_elements > M1)
{ {
PyErr_SetString( PyErr_SetString(
PyExc_ValueError, PyExc_ValueError,
"rng_mrg gpu implementation does not support more than (2**31 -1) samples"); "rng_mrg gpu implementation does not support more than (2**31 -1) samples");
%(fail)s %(fail)s
} }
if (must_alloc_sample) if (must_alloc_sample)
{ {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论