Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
b4536dce
提交
b4536dce
authored
8月 07, 2015
作者:
Iban Harlouchet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
numpydoc for theano/typed_list/basic.py
上级
0a7415d7
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
72 行增加
和
27 行删除
+72
-27
basic.py
theano/typed_list/basic.py
+72
-27
没有找到文件。
theano/typed_list/basic.py
浏览文件 @
b4536dce
...
@@ -48,6 +48,7 @@ class _typed_list_py_operators:
...
@@ -48,6 +48,7 @@ class _typed_list_py_operators:
class
TypedListVariable
(
_typed_list_py_operators
,
Variable
):
class
TypedListVariable
(
_typed_list_py_operators
,
Variable
):
"""
"""
Subclass to add the typed list operators to the basic `Variable` class.
Subclass to add the typed list operators to the basic `Variable` class.
"""
"""
TypedListType
.
Variable
=
TypedListVariable
TypedListType
.
Variable
=
TypedListVariable
...
@@ -104,8 +105,13 @@ getitem = GetItem()
...
@@ -104,8 +105,13 @@ getitem = GetItem()
"""
"""
Get specified slice of a typed list.
Get specified slice of a typed list.
:param x: typed list.
Parameters
:param index: the index of the value to return from `x`.
----------
x
Typed list.
index
The index of the value to return from `x`.
"""
"""
...
@@ -174,8 +180,13 @@ append = Append()
...
@@ -174,8 +180,13 @@ append = Append()
"""
"""
Append an element at the end of another list.
Append an element at the end of another list.
:param x: the base typed list.
Parameters
:param y: the element to append to `x`.
----------
x
The base typed list.
y
The element to append to `x`.
"""
"""
...
@@ -250,8 +261,13 @@ extend = Extend()
...
@@ -250,8 +261,13 @@ extend = Extend()
"""
"""
Append all elements of a list at the end of another list.
Append all elements of a list at the end of another list.
:param x: The typed list to extend.
Parameters
:param toAppend: The typed list that will be added at the end of `x`.
----------
x
The typed list to extend.
toAppend
The typed list that will be added at the end of `x`.
"""
"""
...
@@ -325,9 +341,15 @@ insert = Insert()
...
@@ -325,9 +341,15 @@ insert = Insert()
"""
"""
Insert an element at an index in a typed list.
Insert an element at an index in a typed list.
:param x: the typed list to modify.
Parameters
:param index: the index where to put the new element in `x`.
----------
:param toInsert: The new element to insert.
x
The typed list to modify.
index
The index where to put the new element in `x`.
toInsert
The new element to insert.
"""
"""
...
@@ -356,9 +378,9 @@ class Remove(Op):
...
@@ -356,9 +378,9 @@ class Remove(Op):
out
[
0
]
=
x
out
[
0
]
=
x
"""
"""
i
nelegant workaround for ValueError: The truth value of an
I
nelegant workaround for ValueError: The truth value of an
array with more than one element is ambiguous. Use a.any() or a.all()
array with more than one element is ambiguous. Use a.any() or a.all()
being thrown when trying to remove a matrix from a matrices list
being thrown when trying to remove a matrix from a matrices list
.
"""
"""
for
y
in
range
(
out
[
0
]
.
__len__
()):
for
y
in
range
(
out
[
0
]
.
__len__
()):
if
node
.
inputs
[
0
]
.
ttype
.
values_eq
(
out
[
0
][
y
],
toRemove
):
if
node
.
inputs
[
0
]
.
ttype
.
values_eq
(
out
[
0
][
y
],
toRemove
):
...
@@ -371,13 +393,18 @@ class Remove(Op):
...
@@ -371,13 +393,18 @@ class Remove(Op):
remove
=
Remove
()
remove
=
Remove
()
"""Remove an element from a typed list.
"""Remove an element from a typed list.
:param x: the typed list to be changed.
Parameters
:param toRemove: an element to be removed from the typed list.
----------
x
The typed list to be changed.
toRemove
An element to be removed from the typed list.
We only remove the first instance.
We only remove the first instance.
:note: Python implementation of remove doesn't work when we want to
Notes
remove an ndarray from a list. This implementation works in that
-----
case.
Python implementation of remove doesn't work when we want to remove an ndarray
from a list. This implementation works in that case.
"""
"""
...
@@ -437,7 +464,11 @@ reverse = Reverse()
...
@@ -437,7 +464,11 @@ reverse = Reverse()
"""
"""
Reverse the order of a typed list.
Reverse the order of a typed list.
:param x: the typed list to be reversed.
Parameters
----------
x
The typed list to be reversed.
"""
"""
...
@@ -452,7 +483,7 @@ class Index(Op):
...
@@ -452,7 +483,7 @@ class Index(Op):
def
perform
(
self
,
node
,
inputs
,
outputs
):
def
perform
(
self
,
node
,
inputs
,
outputs
):
"""
"""
i
nelegant workaround for ValueError: The truth value of an
I
nelegant workaround for ValueError: The truth value of an
array with more than one element is ambiguous. Use a.any() or a.all()
array with more than one element is ambiguous. Use a.any() or a.all()
being thrown when trying to remove a matrix from a matrices list
being thrown when trying to remove a matrix from a matrices list
"""
"""
...
@@ -480,7 +511,7 @@ class Count(Op):
...
@@ -480,7 +511,7 @@ class Count(Op):
def
perform
(
self
,
node
,
inputs
,
outputs
):
def
perform
(
self
,
node
,
inputs
,
outputs
):
"""
"""
i
nelegant workaround for ValueError: The truth value of an
I
nelegant workaround for ValueError: The truth value of an
array with more than one element is ambiguous. Use a.any() or a.all()
array with more than one element is ambiguous. Use a.any() or a.all()
being thrown when trying to remove a matrix from a matrices list
being thrown when trying to remove a matrix from a matrices list
"""
"""
...
@@ -499,13 +530,18 @@ count = Count()
...
@@ -499,13 +530,18 @@ count = Count()
"""
"""
Count the number of times an element is in the typed list.
Count the number of times an element is in the typed list.
:param x: The typed list to look into.
Parameters
:param elem: The element we want to count in list.
----------
x
The typed list to look into.
elem
The element we want to count in list.
The elements are compared with equals.
The elements are compared with equals.
:note: Python implementation of count doesn't work when we want to
Notes
count an ndarray from a list. This implementation works in that
-----
case.
Python implementation of count doesn't work when we want to count an ndarray
from a list. This implementation works in that case.
"""
"""
...
@@ -543,7 +579,11 @@ length = Length()
...
@@ -543,7 +579,11 @@ length = Length()
"""
"""
Returns the size of a list.
Returns the size of a list.
:param x: typed list.
Parameters
----------
x
Typed list.
"""
"""
...
@@ -573,7 +613,12 @@ make_list = MakeList()
...
@@ -573,7 +613,12 @@ make_list = MakeList()
"""
"""
Build a Python list from those Theano variable.
Build a Python list from those Theano variable.
:param a: tuple/list of Theano variable
Parameters
----------
a : tuple/list of Theano variable
Notes
-----
All Theano variables must have the same type.
:note: All Theano variable must have the same type.
"""
"""
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论