Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
7a39f5bf
提交
7a39f5bf
authored
8月 04, 2014
作者:
abergeron
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2013 from nouiz/mixed
[CRASH,DOC,ENH] Mixed
上级
6aa85f9e
47738f11
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
29 行增加
和
9 行删除
+29
-9
basic.txt
doc/library/tensor/basic.txt
+8
-0
configdefaults.py
theano/configdefaults.py
+11
-3
configparser.py
theano/configparser.py
+4
-0
test_opt.py
theano/sandbox/cuda/tests/test_opt.py
+3
-3
multinomial.py
theano/sandbox/multinomial.py
+2
-2
test_opt.py
theano/tensor/tests/test_opt.py
+1
-1
没有找到文件。
doc/library/tensor/basic.txt
浏览文件 @
7a39f5bf
...
...
@@ -586,6 +586,14 @@ dimensions, see :meth:`_tensor_py_operators.dimshuffle`.
broadcastable. When performing the function, if the length of `x`
along that dimension is not 1, a ``ValueError`` will be raised.
.. function:: patternbroadcast(x, broadcastable)
Change `x` broadcastable pattern to
`broadcastable`. `broadcastable` must be iterable. For example,
`patternbroadcast(x, (True, False))` will make the first dimension
of `x` broadcastable and the second dimension not broadcastable,
so x will now be a `row`.
.. function:: flatten(x, outdim=1)
Similar to :func:`reshape`, but the shape is inferred from the shape of `x`.
...
...
theano/configdefaults.py
浏览文件 @
7a39f5bf
...
...
@@ -11,10 +11,18 @@ _logger = logging.getLogger('theano.configdefaults')
config
=
TheanoConfigParser
()
def
floatX_convert
(
s
):
if
s
==
"32"
:
return
"float32"
elif
s
==
"64"
:
return
"float64"
else
:
return
s
AddConfigVar
(
'floatX'
,
"Default floating-point precision for python casts"
,
EnumStr
(
'float64'
,
'float32'
),
)
"Default floating-point precision for python casts"
,
EnumStr
(
'float64'
,
'float32'
,
convert
=
floatX_convert
,
),
)
AddConfigVar
(
'cast_policy'
,
"Rules for implicit type casting"
,
...
...
theano/configparser.py
浏览文件 @
7a39f5bf
...
...
@@ -305,7 +305,11 @@ class EnumStr(ConfigParam):
raise
ValueError
(
'Valid values for an EnumStr parameter '
'should be strings'
,
val
,
type
(
val
))
convert
=
kwargs
.
get
(
"convert"
,
None
)
def
filter
(
val
):
if
convert
:
val
=
convert
(
val
)
if
val
in
self
.
all
:
return
val
else
:
...
...
theano/sandbox/cuda/tests/test_opt.py
浏览文件 @
7a39f5bf
...
...
@@ -8,7 +8,7 @@ from nose.plugins.skip import SkipTest
import
theano
from
theano.compile.pfunc
import
pfunc
from
theano
import
config
,
tensor
import
theano.
sandbox.linalg.tests.test_
linalg
import
theano.
tensor.tests.test_n
linalg
from
theano.tests
import
unittest_tools
as
utt
...
...
@@ -393,14 +393,14 @@ def test_erfinvgpu():
assert
numpy
.
allclose
(
f
(
xv
),
f2
(
xv
))
class
test_diag
(
theano
.
sandbox
.
linalg
.
tests
.
test_
linalg
.
test_diag
):
class
test_diag
(
theano
.
tensor
.
tests
.
test_n
linalg
.
test_diag
):
mode
=
mode_with_gpu
shared
=
staticmethod
(
cuda
.
shared_constructor
)
floatX
=
'float32'
type
=
CudaNdarrayType
def
__init__
(
self
,
name
):
super
(
theano
.
sandbox
.
linalg
.
tests
.
test_
linalg
.
test_diag
,
super
(
theano
.
tensor
.
tests
.
test_n
linalg
.
test_diag
,
self
)
.
__init__
(
name
)
...
...
theano/sandbox/multinomial.py
浏览文件 @
7a39f5bf
...
...
@@ -249,12 +249,12 @@ class GpuMultinomialFromUniform(MultinomialFromUniform, GpuOp):
fail
=
sub
[
'fail'
]
return
"""
if (
PyA
rray_NDIM(
%(pvals)
s) != 2)
if (
CudaNda
rray_NDIM(
%(pvals)
s) != 2)
{
PyErr_Format(PyExc_TypeError, "pvals wrong rank");
%(fail)
s;
}
if (
PyA
rray_NDIM(
%(unis)
s) != 1)
if (
CudaNda
rray_NDIM(
%(unis)
s) != 1)
{
PyErr_Format(PyExc_TypeError, "unis wrong rank");
%(fail)
s;
...
...
theano/tensor/tests/test_opt.py
浏览文件 @
7a39f5bf
...
...
@@ -4208,7 +4208,7 @@ def test_local_upcast_elemwise_constant_inputs():
old
=
theano
.
config
.
floatX
theano
.
config
.
floatX
=
'float32'
try
:
v
=
lvector
()
/
2
v
=
lvector
()
function
([
v
],
theano
.
tensor
.
basic
.
true_div
(
v
,
2
))
finally
:
theano
.
config
.
floatX
=
old
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论