提交 ddbf02dd authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Doc + uniformity fix.

上级 09dc8bf3
......@@ -167,6 +167,25 @@ overridden.
For more details you can go see the documentation for :ref:`type`.
Additional definitions
----------------------
For certain mechanisms, you can register functions and other such
things to plus your type into theano's mechanisms. These are optional
but will allow people to use you type with familiar interfaces.
`transfer()`
~~~~~~~~~~~~
To plug in additional options for the transfer target, define a
function which takes a theano variable and a target argument and
returns eitehr a new transferred variable (which can be the same as
the input if no transfer is nessecary) or returns None if the transfer
can't be done.
Then register that function by calling :func:`register_transfer()`
with it as argument.
Defining double
===============
......
......@@ -160,11 +160,14 @@ CudaNdarrayType.SharedVariable = CudaNdarraySharedVariable
def cuda_shared_constructor(value, name=None, strict=False,
allow_downcast=None, borrow=False,
broadcastable=None):
broadcastable=None, target='gpu'):
"""
SharedVariable Constructor for CudaNdarrayType.
"""
if target != 'gpu':
rause TypeError('not for gpu')
# 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.
# THIS IS NOT THE DEFAULT BEHAVIOUR THAT WE WANT.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论