mindspore/docs/api/api_python/ops/mindspore.ops.func_gcd.rst

19 lines
655 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.gcd
=================
.. py:function:: mindspore.ops.gcd(x1, x2)
按元素计算输入Tensor的最大公约数。
两个输入的shape应该是可广播的它们的数据类型应该是int32int64之一。
参数:
- **x1** (Tensor) - 第一个输入。
- **x2** (Tensor) - 第二个输入。
返回:
Tensor返回的shape与广播后的shape数据类型为两个输入中数字精度较高的类型。
异常:
- **TypeError** - 如果 `x1``x2` 的数据类型既不是int32也不是int64。
- **ValueError** - 如果两个输入的shape不可广播。