文件历史

44 次代码提交

作者 SHA1 备注 提交日期
czkkkkkk b57c56d9a1 [Sparse] Support broadcasting operators (#5544) 2023-04-15 10:36:12 +08:00
czkkkkkk 7c465d20fc [Sparse] Support spspdiv (#5541)
Co-authored-by: Hongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
2023-04-14 16:46:51 +08:00
czkkkkkk 893098888e [Sparse] Support spspmul (#5543) 2023-04-13 09:07:49 +08:00
czkkkkkk 92e383c3b8 [Sparse] Remove the Python DiagMatrix class (#5444)
* [Sparse] Remove the Python DiagMatrix class

* Update

* Update

* update

* Update
2023-03-15 18:17:52 +08:00
czkkkkkk 999c624582 [Sparse] Support converson to/from torch sparse tensor. (#5388)
* [Sparse] Support converson to/from torch sparse tensor.

* Update
2023-02-28 17:27:23 +08:00
czkkkkkk 5ffd2a022c [Sparse] Support column-wise softmax (#5377)
* [Sparse] Support column-wise softmax

* Update python/dgl/sparse/softmax.py

Co-authored-by: Mufei Li <mufeili1996@gmail.com>

---------

Co-authored-by: Mufei Li <mufeili1996@gmail.com>
2023-02-24 10:03:43 +08:00
Quan (Andy) Gan f62669b05c enable sparse on windows and mac (#5277)
* enable sparse on windows and mac

* that was stupid

* let's see what's going on..

* [Sparse] Fix the import error on Mac OS.

When using template functions that are defined in source files from DGL,
the loader of MacOS somehow cannot find their definitions. This fix simply
avoids depending on template functions from DGL headers.

With this fix, the sparse tests all pass on the MAC environment.

* ok this is the problem

* make errors clearer

* uh

* test

* Update __init__.py

* disabling ddp on windows

---------

Co-authored-by: czkkkkkk <zekucai@gmail.com>
2023-02-13 13:16:17 +08:00
Hongzhi (Steve), Chen 4b5fa83bcd [Sparse] Swap examples of from_coo and spmatrix. (#5228)
* swap-example

* size-shape

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-27 10:51:57 +08:00
Hongzhi (Steve), Chen 387ae76df3 [Doc] Update with Mono font to keep doc string consistent. (#5213)
* part1

* more

* more

* spmatrix

* code

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-23 09:48:07 +08:00
Hongzhi (Steve), Chen d61012e094 Change example code for indices creation from two line to one line to avoid test break. (#5222)
* add_backslash

* fix

* more

* blabla

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-23 02:21:57 +08:00
Hongzhi (Steve), Chen fbbe6d61c9 [Doc] Update all canonical creation example from from_coo to spmatrix. (#5208)
* fix

* sddmm

* change

* blabla

* blabla

* revert

* newpr

* tocuda

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-20 17:44:07 +08:00
Quan (Andy) Gan abfc4c31f5 [Sparse] Clarification on dimensions for sparse reduction and softmax docstrings (#5197)
* fix sparse reduce and softmax doc

* Update softmax.py
2023-01-20 14:31:33 +08:00
Hongzhi (Steve), Chen 7a2dd5ae96 32 (#5216)
Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-20 11:26:26 +08:00
Hongzhi (Steve), Chen c89ee05f2d examples (#5214)
Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-20 10:46:12 +08:00
czkkkkkk 20ce9be2c6 [Sparse] Add spmatrix creation function (#5209)
* [Sparse] Add spmatrix creation function

* Update

* Update sparse_matrix.py

* Update sparse_matrix.py

Co-authored-by: Hongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
2023-01-20 09:49:49 +08:00
czkkkkkk d1e5700676 [Sparse] Polish the docstring of sparse_matrix.py (#5202)
* [Sparse] Polish the docstring of sparse_matrix.py

* Update

* Update

* Update

* Update
2023-01-20 00:49:20 +08:00
czkkkkkk db77283130 [Sparse] Only support scalar or vector values in SparseMatrix creators (#5204)
* [Sparse] Only support scalar or vector values in SparseMatrix creators

* Update

* Update sparse_matrix.py

Co-authored-by: Hongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
2023-01-19 21:46:46 +08:00
Hongzhi (Steve), Chen d965acab7f Change size to shape in print. (#5207)
Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-19 17:21:11 +08:00
Hongzhi (Steve), Chen c4ffd75223 [Misc] Polish the doc strings. (#5203)
Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-19 16:37:08 +08:00
Mufei Li dffe722f5d Update (#5196)
Co-authored-by: Ubuntu <ubuntu@ip-172-31-36-188.ap-northeast-1.compute.internal>
2023-01-19 10:16:46 +08:00
Hongzhi (Steve), Chen 16dd9584e6 [Sparse] Polish softmax.py. (#5182)
* polish

* [Sparse] Polish softmax.py.

* fix parameter and example

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-17 14:22:10 +08:00
Hongzhi (Steve), Chen 82eb3d71a6 [Sparse] polish strings of matmul.py and sddmm.py. (#5177)
* polish mm docstrings

* fix typo

* small fix.

* fix

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-17 13:55:07 +08:00
Hongzhi (Steve), Chen 84aae0863f [Sparse] Polish reduction.py. (#5180)
* polish

* example

* revert_example

* pylint

* revert_input

* order

* add input as parameter

* example

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-17 13:34:11 +08:00
czkkkkkk f554bc4873 [Sparse] Polish the docstring of SparseMatrix.csr() and SparseMatrix.csc() (#5179)
* [Sparse] Polish the docstring of SparseMatrix.csr() and SparseMatrix.csc()

* Update sparse_matrix.py

* Update

Co-authored-by: Hongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
2023-01-17 13:12:48 +08:00
Hongzhi (Steve), Chen fa74ea706a [Sparse] Polish diag_matrix.py and sparse_matrix.py. (#5178)
* polish diagonal

* polsih

* more

* more

* add paramaters-back

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-17 10:46:11 +08:00
Quan (Andy) Gan 27010dbc55 [Sparse] Sparse matrix subtraction (#5164)
* use NotImplemented

* format

* sparse sub

* address comments

* lint

* Update elementwise_op_diag.py

* ugh

Co-authored-by: Rhett Ying <85214957+Rhett-Ying@users.noreply.github.com>
2023-01-16 11:37:42 +08:00
czkkkkkk 419fb8151b [Sparse] Use X to represent dense tensors in sddmm (#5174)
* [Sparse] Use X to represent dense tensors in sddmm

* indent

* pylint: disable=invalid-name

Co-authored-by: Hongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
2023-01-15 11:52:06 +08:00
Quan (Andy) Gan acc567aa08 [Sparse] Support sparse matrix dividing scalar (#5173)
* use NotImplemented

* format

* extend to pytorch scalar

* sparse div scalar

* oops

* Apply suggestions from code review

Co-authored-by: Mufei Li <mufeili1996@gmail.com>

Co-authored-by: Mufei Li <mufeili1996@gmail.com>
2023-01-13 22:54:58 +08:00
czkkkkkk b5c5c860f6 [Sparse] Refactor matmul interface. (#5162)
* [Sparse] Refactor matmul interface.

* Update
2023-01-13 20:08:40 +08:00
Hongzhi (Steve), Chen 9334421d2b [Sparse] Rename as_sparse to to_sparse, dense to to_dense. (#5170)
* as_sp_to_sp

* dense

* revert_mock

* test

* revert

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-13 17:03:20 +08:00
Quan (Andy) Gan 5f5db2dfc7 [Sparse] Make functions compatible with PyTorch scalar tensors (#5163)
* use NotImplemented

* format

* extend to pytorch scalar

* reformat

* reformat

* lint
2023-01-13 14:00:52 +08:00
czkkkkkk 1d1b08b044 [Sparse] Fix sddmm docstring (#5169) 2023-01-13 13:53:03 +08:00
Quan (Andy) Gan 8abf9d54e3 [Sparse] Use NotImplemented to let Python dispatch types (#5160)
* use NotImplemented

* add TypeError tests

* format

* lint

* fix type

* fix docstring

* lint

* remove redundant condition
2023-01-12 21:12:29 +08:00
czkkkkkk bff32a0986 [Sparse] Use efficient implementation for Diag @ Sparse and Sparse @ Diag. (#5147) 2023-01-12 11:53:46 +08:00
Hongzhi (Steve), Chen b743f767b6 fix (#5151)
Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-12 10:13:18 +08:00
Hongzhi (Steve), Chen 2a78e48f4e polish (#5150)
Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-11 19:55:38 +08:00
Hongzhi (Steve), Chen 41b4180950 Polish (#5149)
Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-11 19:31:08 +08:00
Hongzhi (Steve), Chen 9c647d8095 [Sparse] Add elementwise mul and div method, and polish the python doc. (#5142)
* add mul and div

* polish

* equivalent

* indent

* double

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-11 19:07:32 +08:00
Hongzhi (Steve), Chen d837029925 try again. (#5141)
Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-11 12:59:50 +08:00
Hongzhi (Steve), Chen 1a33ee99d3 [Sparse] Update doc string of element-wise ops for DiagMatrix and SparseMatrix. (#5136)
* doc

* minor

* black

* no-lint

* reorg

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-11 12:08:24 +08:00
Hongzhi (Steve), Chen c5119480f2 [Sparse] Remove unnecessary API exposure. (#5135)
* remove unnecessary exposure.

* remove_add_power

* remove_warning

* reorder

Co-authored-by: Steve <ubuntu@ip-172-31-34-29.ap-northeast-1.compute.internal>
2023-01-11 11:47:14 +08:00
Mufei Li c8bc558880 [Sparse] Remove SparseMatrix.indices and add device/dtype conversions (#5108)
* Update

* Update

* Update

* lint

* lint

* Update

* CI

* Update diag_matrix.py

* Update sparse_matrix.py

* Update sparse_matrix.py

Co-authored-by: Ubuntu <ubuntu@ip-172-31-36-188.ap-northeast-1.compute.internal>
Co-authored-by: Hongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
2023-01-06 17:37:13 +08:00
Mufei Li 9169fc3541 [Sparse] Polish sparse matrix creation functions (#5093)
* update

* Update

* Update

* Update

* Update

Co-authored-by: Ubuntu <ubuntu@ip-172-31-36-188.ap-northeast-1.compute.internal>
2023-01-03 22:59:57 +08:00
Mufei Li 37bd092587 [Sparse] Namespace migration and doc update (#5088)
* update

* lint

* lint

* comments

Co-authored-by: Ubuntu <ubuntu@ip-172-31-36-188.ap-northeast-1.compute.internal>
2022-12-29 20:34:29 +08:00