代码拉取完成,页面将自动刷新
28505
Change SparseTensor to COOTensor
已合并
What type of PR is this?
/kind feature
What does this PR do / why do we need it:
The PR uses COOTensor
to replace the orginal SparseTensor
, and enables the return value type to be COOTensor
instead of tuple
.
Note:
If users still use SparseTensor
to create COOTensor, a warning will appear and remind users to use COOTensor
instead, and the SparseTensor
interface will not be supported in the near future. For example:
from mindspore import SparseTensor, Tensor, ms_function
indices = Tensor([[0, 1], [1, 2]])
values = Tensor([1, 2.])
shape = (3, 4)
def test_pynative():
return SparseTensor(indices, values, shape)
test_graph = ms_function(test_pynative)
out1 = test_pynative()
out2 = test_graph()
print(out1)
print(out2)
Output:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewers: