Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# -*- coding: utf-8 -*- 

2import theano.tensor as tt 

3from theano import gof 

4from .base_op import LimbDarkBaseOp 

5from .get_cl_rev import GetClRevOp 

6 

7__all__ = ["GetClOp"] 

8 

9 

10class GetClOp(LimbDarkBaseOp): 

11 

12 __props__ = () 

13 func_file = "./get_cl.cc" 

14 func_name = "APPLY_SPECIFIC(get_cl)" 

15 num_input = 1 

16 

17 def __init__(self): 

18 self.grad_op = GetClRevOp() 

19 super(GetClOp, self).__init__() 

20 

21 def make_node(self, arg): 

22 return gof.Apply(self, [tt.as_tensor_variable(arg)], [arg.type()]) 

23 

24 def infer_shape(self, node, shapes): 

25 return (shapes[0],) 

26 

27 def grad(self, inputs, gradients): 

28 return (self.grad_op(gradients[0]),) 

29 

30 def R_op(self, inputs, eval_points): 

31 if eval_points[0] is None: 

32 return eval_points 

33 return self.grad(inputs, eval_points)