提交 f5dcfd94 authored 作者: Frederic Bastien's avatar Frederic Bastien

white space fix.

上级 594d8d2f
...@@ -19,7 +19,7 @@ class _operators(tensor.basic._tensor_py_operators): ...@@ -19,7 +19,7 @@ class _operators(tensor.basic._tensor_py_operators):
"""Define a few properties and conversion methods for CudaNdarray Variables. """Define a few properties and conversion methods for CudaNdarray Variables.
The default implementation of arithemetic operators is to build graphs of TensorType The default implementation of arithemetic operators is to build graphs of TensorType
variables. variables.
The optimization pass (specialization) will insert pure GPU implementations. The optimization pass (specialization) will insert pure GPU implementations.
This approach relieves the Cuda-Ops of having to deal with input argument checking and This approach relieves the Cuda-Ops of having to deal with input argument checking and
...@@ -60,7 +60,7 @@ class CudaNdarraySharedVariable(SharedVariable, _operators): ...@@ -60,7 +60,7 @@ class CudaNdarraySharedVariable(SharedVariable, _operators):
""" """
Return the value of this SharedVariable's internal array. Return the value of this SharedVariable's internal array.
:param borrow: :param borrow:
permit the return of internal storage, when used in conjunction with permit the return of internal storage, when used in conjunction with
``return_internal_type=True`` ``return_internal_type=True``
:param return_internal_type: :param return_internal_type:
...@@ -110,7 +110,7 @@ class CudaNdarraySharedVariable(SharedVariable, _operators): ...@@ -110,7 +110,7 @@ class CudaNdarraySharedVariable(SharedVariable, _operators):
* You change the value of the shared variable via set_value, not via the .value * You change the value of the shared variable via set_value, not via the .value
accessors. You should not use the .value accessors anyway, since they will soon be accessors. You should not use the .value accessors anyway, since they will soon be
deprecated and removed. deprecated and removed.
It is also worth mentioning that, for efficient transfer to the GPU, Theano will make the new data It is also worth mentioning that, for efficient transfer to the GPU, Theano will make the new data
``c_contiguous``. This can require an extra copy of the data on the host. ``c_contiguous``. This can require an extra copy of the data on the host.
""" """
...@@ -142,7 +142,7 @@ def cuda_shared_constructor(value, name=None, strict=False, ...@@ -142,7 +142,7 @@ def cuda_shared_constructor(value, name=None, strict=False,
# THIS CONSTRUCTOR TRIES TO CAST VALUE TO A FLOAT32, WHICH THEN GOES ONTO THE CARD # THIS CONSTRUCTOR TRIES TO CAST VALUE TO A FLOAT32, WHICH THEN GOES ONTO THE CARD
# SO INT shared vars, float64 shared vars, etc. all end up on the card. # SO INT shared vars, float64 shared vars, etc. all end up on the card.
# THIS IS NOT THE DEFAULT BEHAVIOUR THAT WE WANT. # THIS IS NOT THE DEFAULT BEHAVIOUR THAT WE WANT.
# SEE float32_shared_constructor # SEE float32_shared_constructor
#TODO: what should strict mean in this context, since we always have to make a copy? #TODO: what should strict mean in this context, since we always have to make a copy?
...@@ -172,7 +172,7 @@ def float32_shared_constructor(value, name=None, strict=False, ...@@ -172,7 +172,7 @@ def float32_shared_constructor(value, name=None, strict=False,
"""SharedVariable Constructor for CudaNdarrayType from numpy.ndarray or CudaNdarray""" """SharedVariable Constructor for CudaNdarrayType from numpy.ndarray or CudaNdarray"""
# if value isn't a float32 ndarray, or a CudaNdarray then raise # if value isn't a float32 ndarray, or a CudaNdarray then raise
if not isinstance(value, (numpy.ndarray, theano.sandbox.cuda.CudaNdarray)): if not isinstance(value, (numpy.ndarray, theano.sandbox.cuda.CudaNdarray)):
raise TypeError('ndarray or CudaNdarray required') raise TypeError('ndarray or CudaNdarray required')
if isinstance(value, numpy.ndarray) and value.dtype.num != CudaNdarrayType.typenum: if isinstance(value, numpy.ndarray) and value.dtype.num != CudaNdarrayType.typenum:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论