Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
27c008d0
提交
27c008d0
authored
11月 24, 2015
作者:
Pascal Lamblin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3652 from nouiz/err_msg
Better error message.
上级
40eb1b30
e6980355
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
16 行增加
和
2 行删除
+16
-2
install.txt
doc/install.txt
+1
-1
basic.py
theano/tensor/basic.py
+7
-1
raw_random.py
theano/tensor/raw_random.py
+8
-0
没有找到文件。
doc/install.txt
浏览文件 @
27c008d0
...
...
@@ -484,7 +484,7 @@ Using the GPU
The first thing you'll need for Theano to use your GPU is Nvidia's
GPU-programming toolchain. You should install at least the CUDA driver and the CUDA Toolkit, as
`described here <http
://www.nvidia.com/object/cuda_get.html
>`_. The CUDA
`described here <http
s://developer.nvidia.com/cuda-toolkit
>`_. The CUDA
Toolkit installs a folder on your computer with subfolders *bin*, *lib*,
*include*, and some more too. (Sanity check: The *bin* subfolder should contain an *nvcc*
program which is the compiler for GPU code.) This folder is called the *cuda
...
...
theano/tensor/basic.py
浏览文件 @
27c008d0
...
...
@@ -4230,7 +4230,8 @@ def get_vector_length(v):
"""
v
=
as_tensor_variable
(
v
)
if
v
.
ndim
!=
1
:
raise
TypeError
(
'argument must be symbolic vector'
)
raise
TypeError
(
"argument must be symbolic vector, got '
%
s'"
%
v
)
if
v
.
type
.
broadcastable
[
0
]:
return
1
if
isinstance
(
v
,
gof
.
Constant
)
and
v
.
type
.
ndim
==
1
:
...
...
@@ -4479,6 +4480,11 @@ class Reshape(Op):
def
reshape
(
x
,
newshape
,
ndim
=
None
,
name
=
None
):
if
ndim
is
None
:
newshape
=
as_tensor_variable
(
newshape
)
if
newshape
.
ndim
!=
1
:
raise
TypeError
(
"New shape in reshape must be a vector or a list/tuple of"
" scalar. Got
%
s after conversion to a vector."
%
newshape
)
try
:
ndim
=
get_vector_length
(
newshape
)
except
ValueError
:
...
...
theano/tensor/raw_random.py
浏览文件 @
27c008d0
...
...
@@ -379,10 +379,18 @@ def _infer_ndim_bcast(ndim, shape, *args):
ndim
=
template
.
ndim
else
:
v_shape
=
tensor
.
as_tensor_variable
(
shape
)
if
v_shape
.
ndim
!=
1
:
raise
TypeError
(
"shape must be a vector or list of scalar, got '
%
s'"
%
v_shape
)
if
ndim
is
None
:
ndim
=
tensor
.
get_vector_length
(
v_shape
)
bcast
=
[
False
]
*
ndim
if
v_shape
.
ndim
!=
1
:
raise
TypeError
(
"shape must be a vector or list of scalar, got '
%
s'"
%
v_shape
)
if
(
not
(
v_shape
.
dtype
.
startswith
(
'int'
)
or
v_shape
.
dtype
.
startswith
(
'uint'
))):
raise
TypeError
(
'shape must be an integer vector or list'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论