mindspore/docs/api/api_python/ops/mindspore.ops.InsertGradien...

23 lines
666 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.InsertGradientOf
==============================
.. py:class:: mindspore.ops.InsertGradientOf(f)
为图节点附加回调函数,将在梯度计算时被调用。
.. warning::
在回调函数中谨慎使用副作用算子如TensorDump算子副作用功能支持尚不完善。
参数:
- **f** (Function) - MindSpore Function 回调函数。
输入:
- **input_x** (Any) - 需要附加回调函数的图节点。
输出:
Tensor直接返回输入 `input_x` 。该算子不影响前向计算的结果。
异常:
- **TypeError** - `f` 不是MindSpore Function。