Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
52bad109
提交
52bad109
authored
4月 01, 2021
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
4月 07, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add missing NumPy functions to aesara.tensor
上级
06c17926
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
20 行增加
和
0 行删除
+20
-0
__init__.py
aesara/tensor/__init__.py
+5
-0
extra_ops.py
aesara/tensor/extra_ops.py
+15
-0
test_extra_ops.py
tests/tensor/test_extra_ops.py
+0
-0
没有找到文件。
aesara/tensor/__init__.py
浏览文件 @
52bad109
...
@@ -63,13 +63,18 @@ from aesara.tensor.blas import batched_dot, batched_tensordot
...
@@ -63,13 +63,18 @@ from aesara.tensor.blas import batched_dot, batched_tensordot
from
aesara.tensor.extra_ops
import
(
from
aesara.tensor.extra_ops
import
(
bartlett
,
bartlett
,
bincount
,
bincount
,
broadcast_shape
,
broadcast_shape_iter
,
broadcast_to
,
cumprod
,
cumprod
,
cumsum
,
cumsum
,
diff
,
fill_diagonal
,
fill_diagonal
,
fill_diagonal_offset
,
fill_diagonal_offset
,
ravel_multi_index
,
ravel_multi_index
,
repeat
,
repeat
,
squeeze
,
squeeze
,
unique
,
unravel_index
,
unravel_index
,
)
)
from
aesara.tensor.io
import
*
from
aesara.tensor.io
import
*
...
...
aesara/tensor/extra_ops.py
浏览文件 @
52bad109
...
@@ -1295,6 +1295,21 @@ class Unique(Op):
...
@@ -1295,6 +1295,21 @@ class Unique(Op):
self
.
axis
=
None
self
.
axis
=
None
def
unique
(
ar
,
return_index
=
False
,
return_inverse
=
False
,
return_counts
=
False
,
axis
=
None
):
"""Find the unique elements of an array.
Returns the sorted unique elements of an array. There are three optional
outputs in addition to the unique elements:
* the indices of the input array that give the unique values
* the indices of the unique array that reconstruct the input array
* the number of times each unique value comes up in the input array
"""
return
Unique
(
return_index
,
return_inverse
,
return_counts
,
axis
)(
ar
)
class
UnravelIndex
(
Op
):
class
UnravelIndex
(
Op
):
__props__
=
(
"order"
,)
__props__
=
(
"order"
,)
...
...
tests/tensor/test_extra_ops.py
浏览文件 @
52bad109
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论