mindspore/docs/api/api_python/ops/mindspore.ops.EuclideanNorm...

23 lines
1.0 KiB
ReStructuredText
Raw 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.EuclideanNorm
============================
.. py:class:: mindspore.ops.EuclideanNorm(keep_dims=False)
计算Tensor沿指定轴的欧几里得范数又称L2范数。默认情况下会移除axis中指定的维度。
参数:
- **keep_dims** (bool可选) - 如果为True被规约的轴保留为1如果为False不保留给定的这些轴默认值False。
输入:
- **x** (Tensor) - 输入Tensor数据类型为float16、float32、float64、int8、int16、
int32、int64、complex64、complex128、uint8、uint16、uint32、uint64。
- **axes** (Tensor) - 指定进行规约计算的维度。数据类型为int32、int64。取值范围为 `[-rank(x), rank(x))`
输出:
Tensor与输入 `x` 具有相同的数据类型。
异常:
- **TypeError** - 如果 `keep_dims` 不是一个bool值。
- **TypeError** - 如果 `x` 不是一个Tensor。
- **ValueError** - 如果 `axes` 超出取值范围。