forked from mindspore-Ecosystem/mindspore
modify function note
This commit is contained in:
parent
5227cb1dff
commit
61fa6d9022
|
@ -5,6 +5,10 @@
|
|||
|
||||
模型训练或推理的高阶接口。 `Model` 会根据用户传入的参数封装可训练或推理的实例。
|
||||
|
||||
.. note::
|
||||
如果使用混合精度功能,需要同时设置`optimizer`参数,否则混合精度功能不生效。
|
||||
当使用混合精度时,优化器中的 `global_step` 可能与模型中的 `cur_step_num` 不同。
|
||||
|
||||
**参数:**
|
||||
|
||||
- **network** (Cell) – 用于训练或推理的神经网络。
|
||||
|
|
|
@ -210,7 +210,7 @@ class Parameter(Tensor_):
|
|||
def __deepcopy__(self, memodict):
|
||||
new_obj = Parameter(self)
|
||||
new_obj.name = self.name
|
||||
new_obj._inited_param = self._inited_param # pylint: disable=W0212
|
||||
new_obj._inited_param = self._inited_param
|
||||
return new_obj
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -411,6 +411,10 @@ class Print(PrimitiveWithInfer):
|
|||
In pynative mode, please use python print function.
|
||||
In graph mode, the bool, int and float would be converted into Tensor to print,
|
||||
str remains unchanged.
|
||||
This function is used for debug. When too many print data at the same time,
|
||||
in order not to affect the main process, the framework may discard some data. At this time,
|
||||
if you need to record the data completely, you can recommended to use the `Summary` function. Please check
|
||||
`Summary <https://www.mindspore.cn/mindinsight/docs/zh-CN/master/summary_record.html?highlight=summary#>`_.
|
||||
|
||||
Inputs:
|
||||
- **input_x** (Union[Tensor, bool, int, float, str]) - The graph node to attach to.
|
||||
|
|
|
@ -93,6 +93,11 @@ class Model:
|
|||
|
||||
`Model` groups layers into an object with training and inference features based on the arguments.
|
||||
|
||||
Note:
|
||||
If use mixed precision functions, need to set parameter `optimizer` at the same time,
|
||||
otherwise mixed precision functions do not take effect.
|
||||
When uses mixed precision functions, `global_step` in optimizer may be different from `cur_step_num` in Model.
|
||||
|
||||
Args:
|
||||
network (Cell): A training or testing network.
|
||||
loss_fn (Cell): Objective function. If `loss_fn` is None, the `network` should contain the calculation of loss
|
||||
|
|
Loading…
Reference in New Issue