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.L2Loss.rst 617 B

4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324
  1. mindspore.ops.L2Loss
  2. ====================
  3. .. py:class:: mindspore.ops.L2Loss()
  4. 用于计算L2范数的一半,但不对结果进行开方操作。
  5. 把输入设为x,输出设为loss。
  6. .. math::
  7. loss = \frac{\sum x ^ 2}{2}
  8. **输入:**
  9. - **input_x** (Tensor) - 用于计算L2范数的Tensor。数据类型必须为float16或float32。
  10. **输出:**
  11. Tensor,具有与 `input_x` 相同的数据类型的Scalar Tensor。
  12. **异常:**
  13. - **TypeError** - `input_x` 不是Tensor。
  14. - **TypeError** - `input_x` 的数据类型既不是float16也不是float32。