Skip to content

Commit

Permalink
[2] Review comment handled
Browse files Browse the repository at this point in the history
  • Loading branch information
ANSHUMAN TRIPATHY authored and ANSHUMAN TRIPATHY committed Feb 18, 2021
1 parent 82b8538 commit 4b43ed7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions python/tvm/relay/op/nn/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -2174,6 +2174,21 @@ def sparse_add(dense_mat, sparse_mat):
-------
result: tvm.relay.Expr
The computed result.
Examples
-------
.. code-block:: python
dense_data = [[ 3., 4., 4. ]
[ 4., 2., 5. ]]
sparse_data = [4., 8.]
sparse_indices =[0, 2]
sparse_indptr =[0, 1, 2]
dense_shape = [2, 3]
output = relay.sparse_add(dense_data, sparse_data, sparse_indices, sparse_indptr)
output = [[ 7., 4., 4. ]
[ 4., 2., 13. ]]
"""
if hasattr(sparse_mat, "indices"):
return _make.sparse_add(dense_mat, sparse_mat.data, sparse_mat.indices, sparse_mat.indptr)
Expand Down

0 comments on commit 4b43ed7

Please sign in to comment.