提交 84784b45 authored 作者: Frederic's avatar Frederic

Document the new flops interface.

上级 450039f7
......@@ -330,6 +330,16 @@ following methods:
shape without computing the output itself, potentially sparing you
a costly recomputation.
.. function:: flops(inputs, outputs)
Optional.
It is only used to have more information printed by the memory
profiler. It make it print the mega flops and giga flops per
second for each apply node. It take as inputs two list: one for the
inputs and one for the outputs. They contain one tuple with the
shape of the corresponding inputs/outputs.
.. function:: make_thunk(node, storage_map, compute_map, no_recycling)
TODO
......
......@@ -86,7 +86,10 @@ Op Contract
def R_op(self, inputs, eval_points):
pass
def infer_shape(node, (i0_shapes, ...))
def infer_shape(node, (i0_shapes, ...)):
pass
def flops(self, inputs, outputs):
pass
.. ../extending/op.txt
......@@ -116,6 +119,11 @@ The :func:`infer_shape` method allows to infer the shape of some variable, somew
middle of the computational graph without actually computing the outputs (when possible).
This could be helpful if one only needs the shape of the output instead of the actual outputs.
The :func:`flops` method allows to have the number of mega flops and
giga flops per second printed by the memory profiler. It take as
inputs two list: one for the inputs and one for the outputs. They
contain one tuple with the shape of the corresponding inputs/outputs.
The :func:`grad` method is required if you want to differentiate some cost whose expression
includes your op.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论