mindspore.ops.coo_sin
- mindspore.ops.coo_sin(x)[源代码]
- 逐元素计算输入COOTensor的正弦。 \[out_i = \sin(x_i)\]- 参数:
- x (COOTensor) - COOTensor的输入。 
 
- 返回:
- COOTensor,shape与 x 相同。 
- 异常:
- TypeError - 如果 x 不是COOTensor。 
- TypeError - 如果 x 的数据类型不是float16、float32、float64、complex64或complex128。 
 
- 支持平台:
- 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_sin(x) >>> print(output.values) [-0.84147096 0.9092974 ]