吃什么食物补钙最快

paddle.sparse. coalesce ( x: Tensor, name: str | None = None ) Tensor [source]
百度 因此,青年学生报考时切莫一味追逐热门岗位,不妨结合自身实力、兴趣、专业等要素,关注一些基层岗位,这样既能增大“上岸”几率,也能为乡村振兴、脱贫攻坚等基层事业注入新鲜血液,带去崭新的面貌。

the coalesced operator include sorted and merge, after coalesced, the indices of x is sorted and unique.

Parameters
  • x (Tensor) – the input SparseCooTensor.

  • name (str|None, optional) – Name for the operation (optional, default is None). For more information, please refer to Name.

Returns

return the SparseCooTensor after coalesced.

Return type

Tensor

Examples

>>> import paddle

>>> indices = [[0, 0, 1], [1, 1, 2]]
>>> values = [1.0, 2.0, 3.0]
>>> sp_x = paddle.sparse.sparse_coo_tensor(indices, values)
>>> sp_x = paddle.sparse.coalesce(sp_x)
>>> print(sp_x.indices())
Tensor(shape=[2, 2], dtype=int64, place=Place(cpu), stop_gradient=True,
[[0, 1],
 [1, 2]])
>>> print(sp_x.values())
Tensor(shape=[2], dtype=float32, place=Place(cpu), stop_gradient=True,
[3., 3.])