You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.ops.Print.rst 1.2 kB

4 years ago
12345678910111213141516171819202122232425
  1. mindspore.ops.Print
  2. ===================
  3. .. py:class:: mindspore.ops.Print
  4. 将输入Tensor或string进行打印输出。
  5. 默认打印在屏幕上。也可以保存在文件中,通过 `context` 设置 `print_file_path` 参数。一旦设置,输出将保存在指定文件中。通过函数 :func:`mindspore.parse_print` 可以重新加载数据。获取更多信息,请查看 :func:`mindspore.context.set_context` 和 :func:`mindspore.parse_print` 。
  6. .. note::
  7. 在PyNative模式下,请使用Python print函数。在Graph模式下,bool、int和float将被转换为Tensor进行打印,str保持不变。
  8. 该方法用于代码调试,当同时print大量数据时,为了保证主进程不受影响,可能会丢失一些数据,这时推荐使用 `Summary` 功能,具体可查看
  9. `Summary <https://www.mindspore.cn/mindinsight/docs/zh-CN/master/summary_record.html?highlight=summary#>`_.
  10. **输入:**
  11. - **input_x** (Union[Tensor, bool, int, float, str]) - Print的输入。支持多个输入,用','分隔。
  12. **输出:**
  13. Tensor,数据类型和shape与 `input_x` 相同。
  14. **异常:**
  15. - **TypeError** - `input_x` 不是Tensor、bool、int、float或str。