Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
e390ce76
提交
e390ce76
authored
12月 16, 2008
作者:
James Bergstra
浏览文件
操作
浏览文件
下载
差异文件
merged
上级
8774bdef
0b92e2d1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
39 行增加
和
22 行删除
+39
-22
function_module.py
theano/compile/function_module.py
+39
-22
没有找到文件。
theano/compile/function_module.py
浏览文件 @
e390ce76
...
@@ -623,32 +623,47 @@ def function(inputs, outputs, mode='FAST_RUN', accept_inplace = False):
...
@@ -623,32 +623,47 @@ def function(inputs, outputs, mode='FAST_RUN', accept_inplace = False):
"""
"""
Return a function calculating the outputs from the inputs.
Return a function calculating the outputs from the inputs.
inputs -> list of SymbolicInput or In instances
:param inputs: list of `SymbolicInput` or `In` instances
outputs -> a SymbolicOutput or a list of SymbolicOutput or Out instances
The return value of the returned function will match the format of this
:param outputs: a SymbolicOutput or a list of `SymbolicOutput` or `Out` instances. The return
argument (either the value itself or a list of one or more return values)
value of the returned function will match the format of this argument (either the value
mode -> a descriptive string or a Mode instance; descriptive strings can be one of:
itself or a list of one or more return values)
* SANITY_CHECK TODO: NotImplemented
* FAST_COMPILE (apply only optimization that are fast to apply)
:param mode: a descriptive string or a Mode instance. (See below for descriptive string
* FAST_RUN (default) (optimize without too much time)
list).
* EXPENSIVE_OPTIMIZATION TODO: NotImplemented
accept_inplace -> True iff the graph can contain inplace operations
Currently, the library provides the following mode strings:
prior to the optimization phase (default is False)
- SANITY_CHECK TODO: NotImplemented
Every element of the input list will be upgraded to an In instance if necessary,
- FAST_COMPILE (apply only optimization that are fast to apply)
- FAST_RUN (default) (optimize without too much time)
- EXPENSIVE_OPTIMIZATION TODO: NotImplemented
:param accept_inplace: True iff the graph can contain inplace operations prior to the
optimization phase (default is False)
Every element of the input list will be upgraded to an `In` instance if necessary,
using the following rules:
using the following rules:
* a Result instance r will be upgraded like In(r)
- a `Result` instance r will be upgraded like `In`(r)
* a tuple (name, r) will be In(r, name=name)
* a tuple (r, val) will be In(r, value=value, autoname=True)
- a tuple (name, r) will be `In`(r, name=name)
* a tuple ((r,up), val) will be In(r, value=value, update=up, autoname=True)
* a tuple (name, r, val) will be In(r, name=name, value=value)
- a tuple (r, val) will be `In`(r, value=value, autoname=True)
* a tuple (name, (r,up), val) will be In(r, name=name, value=val, update=up, autoname=True)
- a tuple ((r,up), val) will be `In`(r, value=value, update=up, autoname=True)
- a tuple (name, r, val) will be `In`(r, name=name, value=value)
- a tuple (name, (r,up), val) will be `In`(r, name=name, value=val, update=up, autoname=True)
Similarly, every element of the output list will be upgraded to an
Similarly, every element of the output list will be upgraded to an
Out
instance if necessary:
`Out`
instance if necessary:
* a
Result instance r will be upgraded like Out
(r)
* a
`Result` instance r will be upgraded like `Out`
(r)
Random Numbers
Random Numbers
...
@@ -656,7 +671,9 @@ def function(inputs, outputs, mode='FAST_RUN', accept_inplace = False):
...
@@ -656,7 +671,9 @@ def function(inputs, outputs, mode='FAST_RUN', accept_inplace = False):
If your computation involves random numbers, then you have to pass the `RandomKit` as an
If your computation involves random numbers, then you have to pass the `RandomKit` as an
input argument. That RandomKit must have a name to be able to seed the generator. To seed
input argument. That RandomKit must have a name to be able to seed the generator. To seed
the generator, use the __getitem__ method:
the generator, use the `__setitem__` method:
..code-block: python
f[<kitname>] = seed #re-seed the elements of a RandomKit
f[<kitname>] = seed #re-seed the elements of a RandomKit
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论