Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
48f4b192
提交
48f4b192
authored
4月 22, 2014
作者:
Frédéric Bastien
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1812 from delallea/minor
Minor fixes
上级
46b19c24
2faa2cd0
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
27 行增加
和
27 行删除
+27
-27
ctype.txt
doc/extending/ctype.txt
+5
-5
install.txt
doc/install.txt
+2
-2
install_ubuntu.txt
doc/install_ubuntu.txt
+1
-1
config.txt
doc/library/config.txt
+1
-1
multi_cores.txt
doc/tutorial/multi_cores.txt
+6
-6
ops.py
theano/compile/ops.py
+2
-2
configdefaults.py
theano/configdefaults.py
+5
-5
cmodule.py
theano/gof/cmodule.py
+1
-1
elemwise_openmp_speedup.py
theano/misc/elemwise_openmp_speedup.py
+1
-1
elemwise_time_test.py
theano/misc/elemwise_time_test.py
+1
-1
basic.py
theano/scalar/basic.py
+2
-2
没有找到文件。
doc/extending/ctype.txt
浏览文件 @
48f4b192
...
@@ -558,9 +558,9 @@ default, it will recompile the c code for each process.
...
@@ -558,9 +558,9 @@ default, it will recompile the c code for each process.
Shape and Shape_i
Shape and Shape_i
=================
=================
We have 2 generic Ops
Shape and Shape_i
that return the shape of any
We have 2 generic Ops
, Shape and Shape_i,
that return the shape of any
Theano Variable that ha
ve a shape attribute and Shape_i return only
of
Theano Variable that ha
s a shape attribute (Shape_i returns only one
of
the element
of the shape
.
the element
s of the shape)
.
.. code-block:: python
.. code-block:: python
...
@@ -568,5 +568,5 @@ the element of the shape.
...
@@ -568,5 +568,5 @@ the element of the shape.
theano.compile.ops.register_shape_c_code(YOUR_TYPE_CLASS, THE_C_CODE, version=())
theano.compile.ops.register_shape_c_code(YOUR_TYPE_CLASS, THE_C_CODE, version=())
theano.compile.ops.register_shape_i_c_code(YOUR_TYPE_CLASS, THE_C_CODE, version=())
theano.compile.ops.register_shape_i_c_code(YOUR_TYPE_CLASS, THE_C_CODE, version=())
The
c code work as the ViewOp. Shape_i have the additional i
parameter
The
C code works as the ViewOp. Shape_i has the additional ``i``
parameter
that you can use with
%(i)s
.
that you can use with
``%(i)s``
.
doc/install.txt
浏览文件 @
48f4b192
...
@@ -234,8 +234,8 @@ From here, the easiest way to get started is (this requires setuptools_ or distr
...
@@ -234,8 +234,8 @@ From here, the easiest way to get started is (this requires setuptools_ or distr
.. note::
.. note::
"python setup.py develop ..." do
n't work on Python 3 as it don'
t call
"python setup.py develop ..." do
es not work on Python 3 as it does no
t call
the converter from Python2 code to Python 3 code.
the converter from Python
2 code to Python 3 code.
This will install a ``.pth`` file in your ``site-packages`` directory that
This will install a ``.pth`` file in your ``site-packages`` directory that
tells Python where to look for your Theano installation (i.e. in the
tells Python where to look for your Theano installation (i.e. in the
...
...
doc/install_ubuntu.txt
浏览文件 @
48f4b192
...
@@ -167,7 +167,7 @@ yourself. Here is some code that will help you.
...
@@ -167,7 +167,7 @@ yourself. Here is some code that will help you.
make FC=gfortran
make FC=gfortran
sudo make PREFIX=/usr/local/ install
sudo make PREFIX=/usr/local/ install
# Tell Theano to use OpenBLAS.
# Tell Theano to use OpenBLAS.
# This work only for the current user.
# This work
s
only for the current user.
# Each Theano user on that computer should run that line.
# Each Theano user on that computer should run that line.
echo -e "\n[blas]\nldflags = -lopenblas\n" >> ~/.theanorc
echo -e "\n[blas]\nldflags = -lopenblas\n" >> ~/.theanorc
...
...
doc/library/config.txt
浏览文件 @
48f4b192
...
@@ -216,7 +216,7 @@ import theano and print the config variable, as in:
...
@@ -216,7 +216,7 @@ import theano and print the config variable, as in:
Positive int value, default: 200000.
Positive int value, default: 200000.
This specifies the vectors minimum size for which elemwise ops
This specifies the vectors minimum size for which elemwise ops
use openmp, if openmp is enable.
use openmp, if openmp is enable
d
.
.. attribute:: cast_policy
.. attribute:: cast_policy
...
...
doc/tutorial/multi_cores.txt
浏览文件 @
48f4b192
...
@@ -17,8 +17,8 @@ those operations will run in parallel in Theano.
...
@@ -17,8 +17,8 @@ those operations will run in parallel in Theano.
The most frequent way to control the number of threads used is via the
The most frequent way to control the number of threads used is via the
``OMP_NUM_THREADS`` environment variable. Set it to the number of
``OMP_NUM_THREADS`` environment variable. Set it to the number of
threads you want to use before starting the
p
ython process. Some BLAS
threads you want to use before starting the
P
ython process. Some BLAS
implementations support other enviroment variables.
implementations support other enviro
n
ment variables.
Parallel element wise ops with OpenMP
Parallel element wise ops with OpenMP
...
@@ -35,9 +35,9 @@ tensor size for which the operation is parallelized because for short
...
@@ -35,9 +35,9 @@ tensor size for which the operation is parallelized because for short
tensors using OpenMP can slow down the operation. The default value is
tensors using OpenMP can slow down the operation. The default value is
``200000``.
``200000``.
For simple
(fast) operation you can obtain a speed
up with very large
For simple
(fast) operations you can obtain a speed-
up with very large
tensors while for more complex operation
you can obtain a good speed
tensors while for more complex operation
s you can obtain a good speed-up
up also for smaller tensor
.
also for smaller tensors
.
There is a script ``elemwise_openmp_speedup.py`` in ``theano/misc/``
There is a script ``elemwise_openmp_speedup.py`` in ``theano/misc/``
which you can use to tune the value of ``openmp_elemwise_minsize`` for
which you can use to tune the value of ``openmp_elemwise_minsize`` for
...
@@ -47,4 +47,4 @@ without OpenMP and shows the time difference between the cases.
...
@@ -47,4 +47,4 @@ without OpenMP and shows the time difference between the cases.
The only way to control the number of threads used is via the
The only way to control the number of threads used is via the
``OMP_NUM_THREADS`` environment variable. Set it to the number of threads
``OMP_NUM_THREADS`` environment variable. Set it to the number of threads
you want to use before starting the
p
ython process.
you want to use before starting the
P
ython process.
theano/compile/ops.py
浏览文件 @
48f4b192
"""This file contain auxiliary Ops, used during the compilation phase
"""This file contain
s
auxiliary Ops, used during the compilation phase
and Ops building class (:class:`FromFunctionOp`) and decorator
and Ops building class (:class:`FromFunctionOp`) and decorator
(:func:`as_op`) that help make new Ops more rapidly.
(:func:`as_op`) that help make new Ops more rapidly.
...
@@ -374,7 +374,7 @@ class FromFunctionOp(gof.Op):
...
@@ -374,7 +374,7 @@ class FromFunctionOp(gof.Op):
Build a basic Theano Op around a function.
Build a basic Theano Op around a function.
Since the resulting Op is very basic and is missing most of the
Since the resulting Op is very basic and is missing most of the
optional functionalit
y, some optimization
may not apply. If you
optional functionalit
ies, some optimizations
may not apply. If you
want to help, you can supply an infer_shape function that computes
want to help, you can supply an infer_shape function that computes
the shapes of the output given the shapes of the inputs.
the shapes of the output given the shapes of the inputs.
...
...
theano/configdefaults.py
浏览文件 @
48f4b192
...
@@ -417,8 +417,8 @@ AddConfigVar('compute_test_value_opt',
...
@@ -417,8 +417,8 @@ AddConfigVar('compute_test_value_opt',
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
'unpickle_function'
,
AddConfigVar
(
'unpickle_function'
,
(
"Replace unpickled Theano function
with None"
,
(
"Replace unpickled Theano function
s with None. "
"This is useful to unpickle old graph that pickled"
"This is useful to unpickle old graph
s
that pickled"
" them when it shouldn't"
),
" them when it shouldn't"
),
BoolParam
(
True
),
BoolParam
(
True
),
in_c_key
=
False
)
in_c_key
=
False
)
...
@@ -483,9 +483,9 @@ AddConfigVar('openmp',
...
@@ -483,9 +483,9 @@ AddConfigVar('openmp',
)
)
AddConfigVar
(
'openmp_elemwise_minsize'
,
AddConfigVar
(
'openmp_elemwise_minsize'
,
"If OpenMP is enable
, this is the minimum size of vector
"
"If OpenMP is enable
d, this is the minimum size of vectors
"
"for which
the openmp parallel for is enable.
"
"for which
the openmp parallelization is enabled
"
"
Used in element wise ops
"
,
"
in element wise ops.
"
,
IntParam
(
200000
),
IntParam
(
200000
),
in_c_key
=
False
,
in_c_key
=
False
,
)
)
theano/gof/cmodule.py
浏览文件 @
48f4b192
...
@@ -1808,7 +1808,7 @@ class GCC_compiler(object):
...
@@ -1808,7 +1808,7 @@ class GCC_compiler(object):
# Python3 compatibility: try to cast Py3 strings as Py2 strings
# Python3 compatibility: try to cast Py3 strings as Py2 strings
try
:
try
:
src_code
=
b
(
src_code
)
src_code
=
b
(
src_code
)
except
:
except
Exception
:
pass
pass
os
.
write
(
fd
,
src_code
)
os
.
write
(
fd
,
src_code
)
os
.
close
(
fd
)
os
.
close
(
fd
)
...
...
theano/misc/elemwise_openmp_speedup.py
浏览文件 @
48f4b192
...
@@ -9,7 +9,7 @@ parser = OptionParser(usage='%prog <options>\n Compute time for'
...
@@ -9,7 +9,7 @@ parser = OptionParser(usage='%prog <options>\n Compute time for'
' fast and slow elemwise operations'
)
' fast and slow elemwise operations'
)
parser
.
add_option
(
'-N'
,
'--N'
,
action
=
'store'
,
dest
=
'N'
,
parser
.
add_option
(
'-N'
,
'--N'
,
action
=
'store'
,
dest
=
'N'
,
default
=
theano
.
config
.
openmp_elemwise_minsize
,
type
=
"int"
,
default
=
theano
.
config
.
openmp_elemwise_minsize
,
type
=
"int"
,
help
=
"Number of vector element"
)
help
=
"Number of vector element
s
"
)
def
runScript
(
N
):
def
runScript
(
N
):
...
...
theano/misc/elemwise_time_test.py
浏览文件 @
48f4b192
...
@@ -11,7 +11,7 @@ parser = OptionParser(usage='%prog <options>\n Compute time for'
...
@@ -11,7 +11,7 @@ parser = OptionParser(usage='%prog <options>\n Compute time for'
' fast and slow elemwise operations'
)
' fast and slow elemwise operations'
)
parser
.
add_option
(
'-N'
,
'--N'
,
action
=
'store'
,
dest
=
'N'
,
parser
.
add_option
(
'-N'
,
'--N'
,
action
=
'store'
,
dest
=
'N'
,
default
=
theano
.
config
.
openmp_elemwise_minsize
,
type
=
"int"
,
default
=
theano
.
config
.
openmp_elemwise_minsize
,
type
=
"int"
,
help
=
"Number of vector element"
)
help
=
"Number of vector element
s
"
)
parser
.
add_option
(
'--script'
,
action
=
'store_true'
,
dest
=
'script'
,
parser
.
add_option
(
'--script'
,
action
=
'store_true'
,
dest
=
'script'
,
default
=
False
,
default
=
False
,
help
=
"Run program as script and print results on stdoutput"
)
help
=
"Run program as script and print results on stdoutput"
)
...
...
theano/scalar/basic.py
浏览文件 @
48f4b192
...
@@ -71,9 +71,9 @@ def upcast(dtype, *dtypes):
...
@@ -71,9 +71,9 @@ def upcast(dtype, *dtypes):
def
get_scalar_type
(
dtype
):
def
get_scalar_type
(
dtype
):
"""
"""
Return a
n
Scalar(dtype) object.
Return a Scalar(dtype) object.
This cache objects to save allocation and run time.
This cache
s
objects to save allocation and run time.
"""
"""
if
dtype
not
in
get_scalar_type
.
cache
:
if
dtype
not
in
get_scalar_type
.
cache
:
get_scalar_type
.
cache
[
dtype
]
=
Scalar
(
dtype
=
dtype
)
get_scalar_type
.
cache
[
dtype
]
=
Scalar
(
dtype
=
dtype
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论