提交 da0fd398 authored 作者: David Warde-Farley's avatar David Warde-Farley

Assert CholeskyGrad has same layout as Cholesky.

Since one of the inputs here is the Cholesky factorization itself, it's important they both be computing the lower triangle or the upper triangle.
上级 05007f20
...@@ -387,6 +387,9 @@ class CholeskyGrad(Op): ...@@ -387,6 +387,9 @@ class CholeskyGrad(Op):
x = as_tensor_variable(x) x = as_tensor_variable(x)
l = as_tensor_variable(l) l = as_tensor_variable(l)
dz = as_tensor_variable(dz) dz = as_tensor_variable(dz)
assert l.owner.op.lower == self.lower, (
"lower/upper mismatch between Cholesky op and CholeskyGrad op"
)
return Apply(self, [x, l, dz], [x.type()]) return Apply(self, [x, l, dz], [x.type()])
def perform(self, node, inputs, outputs): def perform(self, node, inputs, outputs):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论