提交 4fd12c42 authored 作者: Chiheb Trabelsi's avatar Chiheb Trabelsi

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

上级 54fe4a7f
"""
Define CURAND_RandomStreams - backed by CURAND.
"""
from __future__ import absolute_import, print_function, division
__authors__ = "James Bergstra"
__copyright__ = "(c) 2011, University of Montreal"
__license__ = "3-clause BSD License"
__contact__ = "theano-dev@googlegroups.com"
import numpy
import theano.gof
from theano.compat import PY3
......@@ -17,6 +7,15 @@ from theano.tensor import (get_vector_length, cast, opt)
from theano.compile import optdb
from theano.gof import local_optimizer, Variable
__authors__ = "James Bergstra"
__copyright__ = "(c) 2011, University of Montreal"
__license__ = "3-clause BSD License"
__contact__ = "theano-dev@googlegroups.com"
"""
Define CURAND_RandomStreams - backed by CURAND.
"""
config = theano.config
......@@ -70,8 +69,7 @@ class CURAND_Base(GpuOp):
Return a tuple of attributes that define the Op.
"""
return (
self.destructive,
return (self.destructive,
self.output_type,
self.seed,
)
......@@ -101,8 +99,7 @@ class CURAND_Base(GpuOp):
v_size = theano.tensor.as_tensor_variable(size)
if ndim is None:
ndim = get_vector_length(v_size)
self = cls(
output_type=CudaNdarrayType((False,) * ndim),
self = cls(output_type=CudaNdarrayType((False,) * ndim),
seed=seed,
destructive=False)
......@@ -386,5 +383,5 @@ def local_destructive(node):
return new_op.make_node(*node.inputs).outputs
return False
optdb.register('CURAND_destructive',
opt.in2out(local_destructive, ignore_newtrees=True), 99, 'fast_run',
'inplace')
opt.in2out(local_destructive, ignore_newtrees=True),
99, 'fast_run', 'inplace')
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论