提交 1699c267 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

marked neibs grad as unimplemented

上级 d4113c9a
......@@ -3,6 +3,7 @@ from theano import Op, Apply
import theano.tensor as T
from theano.gof import local_optimizer
from theano.sandbox.cuda import cuda_available, GpuOp
from theano.gradient import grad_not_implemented
if cuda_available:
from theano.sandbox.cuda import CudaNdarrayType
......@@ -10,14 +11,6 @@ if cuda_available:
from theano.sandbox.cuda.opt import register_opt as register_gpu_opt
class BadOldCode(Exception):
"""
We create a specific Exception to be sure it does not get caught by
mistake.
"""
pass
class Images2Neibs(Op):
def __init__(self, mode='valid'):
"""
......@@ -91,15 +84,8 @@ class Images2Neibs(Op):
def grad(self, inp, grads):
x, neib_shape, neib_step = inp
gz, = grads
if self.mode in ['valid', 'ignore_borders']:
raise BadOldCode("The Images2Neibs grad is not implemented."
" It was in the past, but returned the wrong"
" answer!")
# This is the reverse of the op, not the grad!
return [neibs2images(gz, neib_shape, x.shape, mode=self.mode),
None, None]
else:
raise NotImplementedError()
return [ grad_not_implemented(self, i, ip) \
for i, ip in enumerate(inp) ]
def c_code_cache_version(self):
return (5,)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论