Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
60e25109
提交
60e25109
authored
2月 05, 2024
作者:
Ricardo Vieira
提交者:
Michael Osthege
3月 24, 2024
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make Constant and Shared variables subclasses of the respective Variables
上级
97317a50
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
5 行增加
和
5 行删除
+5
-5
basic.py
pytensor/sparse/basic.py
+1
-1
sharedvar.py
pytensor/sparse/sharedvar.py
+2
-2
sharedvar.py
pytensor/tensor/sharedvar.py
+2
-2
没有找到文件。
pytensor/sparse/basic.py
浏览文件 @
60e25109
...
@@ -479,7 +479,7 @@ class SparseConstantSignature(tuple):
...
@@ -479,7 +479,7 @@ class SparseConstantSignature(tuple):
return
hash_from_sparse
(
d
)
return
hash_from_sparse
(
d
)
class
SparseConstant
(
TensorConstant
,
_sparse_py_operators
):
class
SparseConstant
(
SparseVariable
,
TensorConstant
):
format
=
property
(
lambda
self
:
self
.
type
.
format
)
format
=
property
(
lambda
self
:
self
.
type
.
format
)
def
signature
(
self
):
def
signature
(
self
):
...
...
pytensor/sparse/sharedvar.py
浏览文件 @
60e25109
...
@@ -3,11 +3,11 @@ import copy
...
@@ -3,11 +3,11 @@ import copy
import
scipy.sparse
import
scipy.sparse
from
pytensor.compile
import
shared_constructor
from
pytensor.compile
import
shared_constructor
from
pytensor.sparse.basic
import
SparseTensorType
,
_sparse_py_operators
from
pytensor.sparse.basic
import
SparseTensorType
,
SparseVariable
from
pytensor.tensor.sharedvar
import
TensorSharedVariable
from
pytensor.tensor.sharedvar
import
TensorSharedVariable
class
SparseTensorSharedVariable
(
TensorSharedVariable
,
_sparse_py_operators
):
class
SparseTensorSharedVariable
(
TensorSharedVariable
,
SparseVariable
):
@property
@property
def
format
(
self
):
def
format
(
self
):
return
self
.
type
.
format
return
self
.
type
.
format
...
...
pytensor/tensor/sharedvar.py
浏览文件 @
60e25109
...
@@ -6,7 +6,7 @@ from pytensor.compile import SharedVariable, shared_constructor
...
@@ -6,7 +6,7 @@ from pytensor.compile import SharedVariable, shared_constructor
from
pytensor.misc.safe_asarray
import
_asarray
from
pytensor.misc.safe_asarray
import
_asarray
from
pytensor.tensor
import
_get_vector_length
from
pytensor.tensor
import
_get_vector_length
from
pytensor.tensor.type
import
TensorType
from
pytensor.tensor.type
import
TensorType
from
pytensor.tensor.variable
import
_tensor_py_operators
from
pytensor.tensor.variable
import
TensorVariable
def
__getattr__
(
name
):
def
__getattr__
(
name
):
...
@@ -31,7 +31,7 @@ def load_shared_variable(val):
...
@@ -31,7 +31,7 @@ def load_shared_variable(val):
return
tensor_constructor
(
val
)
return
tensor_constructor
(
val
)
class
TensorSharedVariable
(
_tensor_py_operators
,
Shared
Variable
):
class
TensorSharedVariable
(
SharedVariable
,
Tensor
Variable
):
def
zero
(
self
,
borrow
:
bool
=
False
):
def
zero
(
self
,
borrow
:
bool
=
False
):
r"""Set the values of a shared variable to 0.
r"""Set the values of a shared variable to 0.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论