提交 3de5ca32 authored 作者: abalkin's avatar abalkin

Return grad_not_implemented() from Diagonal.grad().

上级 6e60fe28
...@@ -25,6 +25,7 @@ from theano.tensor.utils import hash_from_ndarray ...@@ -25,6 +25,7 @@ from theano.tensor.utils import hash_from_ndarray
from theano.scalar import ComplexError, IntegerDivisionError from theano.scalar import ComplexError, IntegerDivisionError
import theano.scalar.sharedvar import theano.scalar.sharedvar
from theano.gradient import grad_undefined from theano.gradient import grad_undefined
from theano.gradient import grad_not_implemented
from theano.gradient import DisconnectedType from theano.gradient import DisconnectedType
### set up the external interface ### set up the external interface
...@@ -7213,7 +7214,7 @@ class Diagonal(Op): ...@@ -7213,7 +7214,7 @@ class Diagonal(Op):
z[0] = x.diagonal(self.offset, self.axis1, self.axis2) z[0] = x.diagonal(self.offset, self.axis1, self.axis2)
def grad(self, (x,), (gz,)): def grad(self, (x,), (gz,)):
return [square_diagonal(gz)] return [grad_not_implemented(self, 0, x)]
def infer_shape(self, node, shapes): def infer_shape(self, node, shapes):
in_shape, = shapes in_shape, = shapes
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论