No, If it work on the CPU, it should not inherit from GpuOp.

Currently, we don't have a clean way for op that work on both CPU and GPU.


On Mon, Jul 22, 2013 at 4:32 PM, lamblin <notifications@github.com> wrote:

> In theano/tensor/nnet/conv3d2d.py:
>
> > +def get_diagonal_subtensor_view(x, i0, i1):
> > +    if x.shape[i0] < x.shape[i1]:
> > +        raise NotImplementedError('is this allowed?')
> > +    idx = [slice(None)] * x.ndim
> > +    idx[i0] = slice(x.shape[i1] - 1, None, None)
> > +    xview = x.__getitem__(tuple(idx))
> > +    strides = list(xview.strides)
> > +    strides[i1] -= strides[i0]
> > +    xview.strides = strides
> > +    return xview
> > +
> > +
> > +class DiagonalSubtensor(Op):
> > +    """
> > +    Work on the GPU.
> > +    """
>
> Should it inherit from GpuOp, then?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Theano/Theano/pull/1454/files#r5329732>
> .
>