提交 b0d922e9 authored 作者: Hengjean's avatar Hengjean

Added check-input to <class 'theano.tensor.subtensor.Subtensor'>

<class 'theano.tensor.subtensor.IncSubtensor'> <class 'theano.tensor.elemwise.DimShuffle'>
上级 67ff204d
......@@ -95,6 +95,8 @@ class DimShuffle(Op):
Adding, subtracting dimensions can be done with reshape.
"""
check_input = False
def __init__(self, input_broadcastable, new_order, inplace=False):
"""
Usage: DimShuffle(input_broadcastable, new_order, inplace = False)
......@@ -369,7 +371,7 @@ PyArray_SetBaseObject(%(res)s, (PyObject*)%(basename)s);
return full_code % dict(locals(), **sub)
def c_code_cache_version(self):
return (2,)
return (3,)
def grad(self, inp, grads):
x, = inp
......
......@@ -277,7 +277,7 @@ class Subtensor(Op):
e_subslice = 'nested slicing is not supported'
e_indextype = "Invalid index type or slice for Subtensor"
debug = 0
check_input = False
view_map = {0: [0]}
@staticmethod
......@@ -892,7 +892,7 @@ class Subtensor(Op):
# have a versioned version of this op's C code.
if len(hv) == 0:
return ()
return (2, hv)
return (3, hv)
def R_op(self, inputs, eval_points):
# Subtensor is not differentiable wrt to its indices, therefore we
......@@ -1074,6 +1074,8 @@ class IncSubtensor(Op):
of incrementing it by that value.
"""
check_input = False
def __init__(self, idx_list, inplace=False, set_instead_of_inc=False,
destroyhandler_tolerate_aliased=None):
if destroyhandler_tolerate_aliased is None:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论