mindspore.ops.coo_floor
- mindspore.ops.coo_floor(x)[源代码]
- COOTensor逐元素向下取整函数。 \[out_i = \lfloor x_i \rfloor\]- 参数:
- x (COOTensor) - Floor的输入,任意维度的COOTensor。其数据类型必须为float16、float32、float64。 
 
- 返回:
- COOTensor,shape与 x 相同。 
- 异常:
- TypeError - x 的数据类型不是COOTensor。 
- TypeError - x 的数据类型不是float16、float32、float64。 
 
- 支持平台:
- Ascend- GPU- CPU
 - 样例: - >>> from mindspore import dtype as mstype >>> from mindspore import Tensor, ops, COOTensor >>> indices = Tensor([[0, 1], [1, 2]], dtype=mstype.int64) >>> values = Tensor([-1, 2], dtype=mstype.float32) >>> shape = (3, 4) >>> x = COOTensor(indices, values, shape) >>> output = ops.coo_floor(x) >>> print(output.values) [-1. 2.]