Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
95e9d0f5
提交
95e9d0f5
authored
5月 28, 2012
作者:
lamblin
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #662 from nouiz/small
Small
上级
deb3091f
5cc5edf0
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
37 行增加
和
7 行删除
+37
-7
index.txt
doc/index.txt
+1
-0
config.txt
doc/library/config.txt
+3
-0
extending_theano.txt
doc/tutorial/extending_theano.txt
+4
-0
__init__.py
theano/__init__.py
+6
-1
configdefaults.py
theano/configdefaults.py
+2
-1
test_blas.py
theano/sandbox/cuda/tests/test_blas.py
+11
-4
blas.py
theano/tensor/blas.py
+6
-0
__init__.py
theano/tests/__init__.py
+4
-1
没有找到文件。
doc/index.txt
浏览文件 @
95e9d0f5
...
@@ -131,6 +131,7 @@ Community
...
@@ -131,6 +131,7 @@ Community
library/index
library/index
optimizations
optimizations
extending/index
extending/index
dev_start_guide
glossary
glossary
links
links
internal/index
internal/index
...
...
doc/library/config.txt
浏览文件 @
95e9d0f5
...
@@ -115,6 +115,9 @@ import theano and print the config variable, as in:
...
@@ -115,6 +115,9 @@ import theano and print the config variable, as in:
This flag's value cannot be modified during the program execution.
This flag's value cannot be modified during the program execution.
Do not use upper case letters, only lower case even if NVIDIA use
capital letters.
.. attribute:: force_device
.. attribute:: force_device
Bool value: either ``True`` or ``False``
Bool value: either ``True`` or ``False``
...
...
doc/tutorial/extending_theano.txt
浏览文件 @
95e9d0f5
...
@@ -211,6 +211,10 @@ see it fail, you can implement an incorrect ``infer_shape``.
...
@@ -211,6 +211,10 @@ see it fail, you can implement an incorrect ``infer_shape``.
.. code-block:: python
.. code-block:: python
from theano.tests import unittest_tools as utt
from theano import config
class test_Double(utt.InferShapeTester):
# [...] as previous tests.
def test_infer_shape(self):
def test_infer_shape(self):
x = theano.tensor.matrix()
x = theano.tensor.matrix()
self._compile_and_check([x], # theano.function inputs
self._compile_and_check([x], # theano.function inputs
...
...
theano/__init__.py
浏览文件 @
95e9d0f5
...
@@ -78,7 +78,12 @@ from compile import \
...
@@ -78,7 +78,12 @@ from compile import \
from
misc.safe_asarray
import
_asarray
from
misc.safe_asarray
import
_asarray
import
theano.tests
import
theano.tests
test
=
theano
.
tests
.
TheanoNoseTester
()
.
test
if
hasattr
(
theano
.
tests
,
"TheanoNoseTester"
):
test
=
theano
.
tests
.
TheanoNoseTester
()
.
test
else
:
def
test
():
raise
ImportError
(
"The nose module is not installed."
" It is needed for Theano tests."
)
FancyModule
=
Module
FancyModule
=
Module
...
...
theano/configdefaults.py
浏览文件 @
95e9d0f5
...
@@ -46,7 +46,8 @@ AddConfigVar('int_division',
...
@@ -46,7 +46,8 @@ AddConfigVar('int_division',
AddConfigVar
(
'device'
,
AddConfigVar
(
'device'
,
(
"Default device for computations. If gpu*, change the default to try "
(
"Default device for computations. If gpu*, change the default to try "
"to move computation to it and to put shared variable of float32 "
"to move computation to it and to put shared variable of float32 "
"on it."
),
"on it. Do not use upper case letters, only lower case even if "
"NVIDIA use capital letters."
),
EnumStr
(
'cpu'
,
'gpu'
,
EnumStr
(
'cpu'
,
'gpu'
,
'gpu0'
,
'gpu1'
,
'gpu2'
,
'gpu3'
,
'gpu0'
,
'gpu1'
,
'gpu2'
,
'gpu3'
,
'gpu4'
,
'gpu5'
,
'gpu6'
,
'gpu7'
,
'gpu4'
,
'gpu5'
,
'gpu6'
,
'gpu7'
,
...
...
theano/sandbox/cuda/tests/test_blas.py
浏览文件 @
95e9d0f5
...
@@ -327,10 +327,17 @@ class TestGpuGemv(TestCase, BaseGemv,
...
@@ -327,10 +327,17 @@ class TestGpuGemv(TestCase, BaseGemv,
mode
=
mode_with_gpu
mode
=
mode_with_gpu
dtype
=
'float32'
dtype
=
'float32'
# As all input are transfered to the gpu, this allow to make all
gemv
=
gpu_gemv_no_inplace
# the gemv inplace.
gemv
=
gpu_gemv_inplace
gemv_inplace
=
gpu_gemv_inplace
gemv_inplace
=
gpu_gemv_inplace
# Mimic shared constructors registry
@staticmethod
def
shared
(
val
):
# If we don't put shared on the GPU, we won't be able to test
# the no inplace version as the added transfer will make them inplace.
try
:
return
tcn
.
shared_constructor
(
val
)
except
TypeError
:
return
theano
.
shared
(
val
)
class
TestGpuGemvNoTransfer
(
TestCase
,
BaseGemv
,
class
TestGpuGemvNoTransfer
(
TestCase
,
BaseGemv
,
...
@@ -435,7 +442,7 @@ class TestVectorMatrixDot(TestCase):
...
@@ -435,7 +442,7 @@ class TestVectorMatrixDot(TestCase):
def
test_gemv2
(
self
):
def
test_gemv2
(
self
):
''' test vector1+dot(vector2,matrix) '''
''' test vector1+dot(vector2,matrix) '''
v1
=
theano
.
shared
(
numpy
.
array
(
numpy
.
random
.
rand
(
5
),
dtype
=
'float32'
))
v1
=
theano
.
shared
(
numpy
.
array
(
numpy
.
random
.
rand
(
5
),
dtype
=
'float32'
))
v2
=
t
heano
.
shared
(
numpy
.
array
(
numpy
.
random
.
rand
(
2
),
dtype
=
'float32'
))
v2
=
t
ensor
.
_
shared
(
numpy
.
array
(
numpy
.
random
.
rand
(
2
),
dtype
=
'float32'
))
m
=
theano
.
shared
(
numpy
.
array
(
numpy
.
random
.
rand
(
5
,
2
),
m
=
theano
.
shared
(
numpy
.
array
(
numpy
.
random
.
rand
(
5
,
2
),
dtype
=
'float32'
))
dtype
=
'float32'
))
...
...
theano/tensor/blas.py
浏览文件 @
95e9d0f5
...
@@ -378,6 +378,12 @@ def ldflags(libs=True, flags=False, libs_dir=False, include_dir=False):
...
@@ -378,6 +378,12 @@ def ldflags(libs=True, flags=False, libs_dir=False, include_dir=False):
"ATLAS, make sure to compile it with dynamics library."
)
"ATLAS, make sure to compile it with dynamics library."
)
for
t
in
config
.
blas
.
ldflags
.
split
():
for
t
in
config
.
blas
.
ldflags
.
split
():
#Remove extra quote.
if
t
.
startswith
(
"'"
)
or
t
.
startswith
(
'"'
):
t
=
t
[
1
:]
if
t
.
endswith
(
"'"
)
or
t
.
endswith
(
'"'
):
t
=
t
[:
-
1
]
try
:
try
:
t0
,
t1
,
t2
=
t
[
0
:
3
]
t0
,
t1
,
t2
=
t
[
0
:
3
]
assert
t0
==
'-'
assert
t0
==
'-'
...
...
theano/tests/__init__.py
浏览文件 @
95e9d0f5
from
main
import
main
,
TheanoNoseTester
try
:
from
main
import
main
,
TheanoNoseTester
except
ImportError
:
pass
import
unittest_tools
import
unittest_tools
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论