Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
3a74c6ae
提交
3a74c6ae
authored
10月 27, 2014
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2218 from nouiz/mixed
Doc, error message
上级
49d2b3f9
84664b81
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
36 行增加
和
33 行删除
+36
-33
shared.txt
doc/library/compile/shared.txt
+4
-22
sharedvalue.py
theano/compile/sharedvalue.py
+22
-4
link.py
theano/gof/link.py
+4
-3
cuda_ndarray.cu
theano/sandbox/cuda/cuda_ndarray.cu
+6
-4
没有找到文件。
doc/library/compile/shared.txt
浏览文件 @
3a74c6ae
...
...
@@ -47,21 +47,11 @@
:type: class:`Container`
..
function:: shared(value, name=None, strict=False, **kwargs)
..
autofunction:: theano.compile.sharedvalue.shared
Return a :class:`SharedVariable` Variable, initialized with a copy or reference of `value`.
This function iterates over constructor functions (see `shared_constructor`) to find a
suitable SharedVariable subclass. The suitable one is the first constructor
that doesn't raise an exception.
This function is meant as a convenient default. If you want to use a
specific shared variable constructor, consider calling it directly.
.. note::
.. function:: shared_constructor(ctor)
By passing `kwargs`, you effectively limit the set of potential constructors to those that
can accept those kwargs.
Append `ctor` to the list of shared constructors (see :func:`shared`).
Each registered constructor ``ctor`` will be called like this:
...
...
@@ -69,12 +59,4 @@
ctor(value, name=name, strict=strict, **kwargs)
.. attribute:: constructors
A list of shared variable constructors that will be tried in reverse
order.
.. function:: shared_constructor(ctor)
Append `ctor` to the list of shared constructors (see :func:`shared`).
If it do not support given value, it must raise a TypeError.
theano/compile/sharedvalue.py
浏览文件 @
3a74c6ae
...
...
@@ -169,15 +169,33 @@ def shared(value, name=None, strict=False, allow_downcast=None, **kwargs):
"""Return a SharedVariable Variable, initialized with a copy or
reference of `value`.
This function iterates over constructor functions (see
`shared_constructor`) to find a suitable SharedVariable subclass.
This function iterates over
:ref:`constructor functions <shared_constructor>`
to find a suitable SharedVariable subclass.
The suitable one is the first constructor that accept the given value.
This function is meant as a convenient default. If you want to use a
specific shared variable constructor, consider calling it directly.
``theano.shared`` is a shortcut to this function.
:note: By passing kwargs, you effectively limit the set of
potential constructors to those that can accept those kwargs.
potential constructors to those that can accept those kwargs.
:note: Some shared variable have
'borrow'
as extra kwargs.
:note: Some shared variable have
``borrow``
as extra kwargs.
`See <http://deeplearning.net/software/theano/tutorial/aliasing.html#borrowing-when-creating-shared-variables>`_ for detail.
:note: Some shared variable have ``broadcastable`` as extra kwargs.
As shared variable shapes can change, all dimensions default
to not being broadcastable, even if ``value`` has a shape of 1
along some dimension. This parameter allows you to create
for example a `row` or `column` 2d tensor.
.. attribute:: constructors
A list of shared variable constructors that will be tried in reverse
order.
"""
try
:
...
...
theano/gof/link.py
浏览文件 @
3a74c6ae
...
...
@@ -154,9 +154,10 @@ def raise_with_op(node, thunk=None, exc_info=None):
else
:
hints
.
append
(
"HINT: Re-running with most Theano optimization disabled could"
" give you a back-traces when this node was created. This can"
" be done with by setting the Theano flags"
" optimizer=fast_compile"
)
" give you a back-trace of when this node was created. This can"
" be done with by setting the Theano flag"
" 'optimizer=fast_compile'. If that does not work,"
" Theano optimizations can be disabled with 'optimizer=None'."
)
if
theano
.
config
.
exception_verbosity
==
'high'
:
f
=
StringIO
.
StringIO
()
...
...
theano/sandbox/cuda/cuda_ndarray.cu
浏览文件 @
3a74c6ae
...
...
@@ -3025,15 +3025,17 @@ CudaNdarray_ptr_int_size(PyObject* _unused, PyObject* args)
{
int
*
gpu_data
=
(
int
*
)
device_malloc
(
sizeof
(
int
)
*
2
);
if
(
gpu_data
==
NULL
){
return
PyErr_Format
(
PyExc_MemoryError
,
"CudaNdarray_ptr_int_size: Can't allocate memory on the gpu."
);
return
NULL
;
}
get_gpu_ptr_size
<<<
1
,
1
>>>
(
gpu_data
);
if
(
cudaSuccess
!=
cudaGetLastError
()){
cudaError_t
cudaErr
=
cudaGetLastError
();
if
(
cudaSuccess
!=
cudaErr
){
device_free
(
gpu_data
);
return
PyErr_Format
(
PyExc_RuntimeError
,
"CudaNdarray_ptr_int_size: error when calling the gpu code."
);
"CudaNdarray_ptr_int_size: error when calling the gpu code. (%s)"
,
cudaGetErrorString
(
cudaErr
));
}
// Transfer the result to cpu
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论