mindspore.ops.cond
- mindspore.ops.cond(A, p=None)[source]
Return the matrix norm or vector norm of a given tensor.
p is the calculation mode of norm. The following norm modes are supported.
Note
Currently, complex numbers are not supported.
- Parameters:
- Returns:
Tensor
- Supported Platforms:
GPUCPU
Examples
>>> import mindspore >>> x = mindspore.tensor([[1.0, 0.0, -1.0], [0.0, 1.0, 0.0], [1.0, 0.0, 1.0]]) >>> print(mindspore.ops.cond(x)) 1.4142 >>> print(mindspore.ops.cond(x, 'fro')) 3.1622777