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

20 lines
534 B
ReStructuredText
Raw Permalink Normal View History

2022-05-29 11:14:01 +08:00
mindspore.ops.InsertGradientOf
==============================
.. py:class:: mindspore.ops.InsertGradientOf(f)
为图节点附加回调函数,将在梯度计算时被调用。
2022-07-26 10:27:56 +08:00
参数:
- **f** (Function) - MindSpore Function。回调函数。
2022-05-29 11:14:01 +08:00
2022-07-26 10:27:56 +08:00
输入:
- **input_x** (Any) - 需要附加回调函数的图节点。
2022-05-29 11:14:01 +08:00
2022-07-26 10:27:56 +08:00
输出:
Tensor直接返回输入 `input_x` 。该算子不影响前向计算的结果。
2022-05-29 11:14:01 +08:00
2022-07-26 10:27:56 +08:00
异常:
- **TypeError** - `f` 不是MindSpore Function。
2022-05-29 11:14:01 +08:00