@@ -215,7 +215,7 @@ Optional methods or attributes
215215 will use your Op and build the graphs that you want and call that
216216 instead of the Op instance directly.
217217
218- .. function:: infer_shape(node, shapes)
218+ .. function:: infer_shape(fgraph, node, shapes)
219219
220220 This function is needed for shape optimization. ``shapes`` is a
221221 list with one tuple for each input of the Apply node (which corresponds
@@ -254,7 +254,7 @@ Optional methods or attributes
254254 If you set `__props__`, this will be automatically generated.
255255 You can still overide it for custom output.
256256
257- .. function:: do_constant_folding(node)
257+ .. function:: do_constant_folding(fgraph, node)
258258
259259 *Default:* Return True
260260
@@ -323,7 +323,7 @@ These are the function required to work with gradient.grad().
323323 return the gradient of the Op's output. theano.tensor.grad computes
324324 gradients; Op.grad is a helper function that computes terms that
325325 appear in gradients.
326-
326+
327327 If an Op has a single vector-valued output y and a single
328328 vector-valued input x, then the grad method will be passed x and a
329329 second vector z. Define J to be the Jacobian of y with respect to
@@ -393,7 +393,7 @@ These are the function required to work with gradient.grad().
393393 :math:`[grad_{x_1}(C), grad_{x_2}(C), ..., grad_{x_m}(C)]`, where
394394 :math:`(grad_{y}(Z))_i = \frac{\partial Z}{\partial y_i}` (and
395395 :math:`i` can stand for multiple dimensions).
396-
396+
397397 In other words, :func:`grad` does not return :math:`\frac{d f_i}{d
398398 x_j}`, but instead the appropriate dot product specified by the
399399 chain rule: :math:`\frac{d C}{d x_j} = \frac{d C}{d f_i} \cdot
@@ -402,7 +402,7 @@ These are the function required to work with gradient.grad().
402402
403403 Theano currently imposes the following constraints on the values
404404 returned by the grad method:
405-
405+
406406 1) They must be Variable instances.
407407 2) When they are types that have dtypes, they must never have an integer dtype.
408408
@@ -525,27 +525,27 @@ These are the function required to work with gradient.grad().
525525
526526 This function implements the application of the R-operator on the
527527 function represented by your op. Let assume that function is :math:`f`,
528- with input :math:`x`, applying the R-operator means computing the
529- Jacobian of :math:`f` and right-multiplying it by :math:`v`, the evaluation
530- point, namely: :math:`\frac{\partial f}{\partial x} v`.
528+ with input :math:`x`, applying the R-operator means computing the
529+ Jacobian of :math:`f` and right-multiplying it by :math:`v`, the evaluation
530+ point, namely: :math:`\frac{\partial f}{\partial x} v`.
531531
532- ``inputs`` are the symbolic variables corresponding to the value of
532+ ``inputs`` are the symbolic variables corresponding to the value of
533533 the input where you want to evaluate the jacobian, and ``eval_points``
534534 are the symbolic variables corresponding to the value you want to
535- right multiply the jacobian with.
535+ right multiply the jacobian with.
536536
537537 Same conventions as for the grad method hold. If your op is not
538- differentiable, you can return None. Note that in contrast to
538+ differentiable, you can return None. Note that in contrast to
539539 the method :func:`grad`, for :func:`R_op` you need to return the
540540 same number of outputs as there are ouputs of the op. You can think
541541 of it in the following terms. You have all your inputs concatenated
542- into a single vector :math:`x`. You do the same with the evaluation
542+ into a single vector :math:`x`. You do the same with the evaluation
543543 points (which are as many as inputs and of the shame shape) and obtain
544- another vector :math:`v`. For each output, you reshape it into a vector,
545- compute the jacobian of that vector with respect to :math:`x` and
544+ another vector :math:`v`. For each output, you reshape it into a vector,
545+ compute the jacobian of that vector with respect to :math:`x` and
546546 multiply it by :math:`v`. As a last step you reshape each of these
547- vectors you obtained for each outputs (that have the same shape as
548- the outputs) back to their corresponding shapes and return them as the
547+ vectors you obtained for each outputs (that have the same shape as
548+ the outputs) back to their corresponding shapes and return them as the
549549 output of the :func:`R_op` method.
550550
551551 :ref:`List of op with r op support <R_op_list>`.
@@ -777,4 +777,3 @@ your disposal to create these objects as efficiently as possible.
777777
778778**Exercise**: Make a generic DoubleOp, where the number of
779779arguments can also be given as a parameter.
780-
0 commit comments